COMPUTER PROGRAMMING
Pages
Home
Tuesday, 25 December 2012
FACTORIAL OF A NUMBER
/* Factorial Of A Number */
#include<stdio.h>
void main()
{
int n,f=1,i=1;
printf("Enter the number:\n");
scanf("%d",&n);
while(i<=n)
{
f=f*i;
i++;
}
printf("Factorial of the number is %d",f);
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment