C Programming (ج البرمجة)
Pages
Home Page
Programming and IT Research Center
Basic Electronic for C.S.E
Saturday, July 20, 2013
Factorial in C Program
Factorial in C Program
#include<stdio.h>
main()
{
int num,f,i;
printf("Enter a number: ");
scanf("%d",&num);
f=1;
i=1;
while(i<=num)
{
f = f * i;
i++;
}
printf("Factorial of %d is: %d",num,f);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment