Program to calculate the factorial of a number.
#include<stdio.h>
#include<conio.h>
main()
{
int x,n;
printf("Enter a
number :");
scanf("%d",&n);
x=fact(n);
printf("%d",x);
}
int fact(int n)
{
int f=1;
while(n>0)
{
f=f*n;
n--;
}
return f;
}