Blog Archive

Sunday, August 29, 2010

Find factorial of a number

/*
Find factorial of a number
*/
#include
#include
void main()
{
int number=0,fact=1;
printf("Enter Number.");
scanf("%d",&number);
while(number>0)
{
fact *=number--;
}
printf("Factorial is %d",fact);
return;
}

No comments:

Post a Comment