#include <stdio.h>
#include <conio.h>
int main()
{
int num, i, sum=1;
printf("Enter a number: ");
scanf("%d", &num);
for(i=1; i<=num; i++)
{
sum=sum*i;
}
printf("Factorial of %d is %d.", num, sum);
getch();
}
#include <conio.h>
int main()
{
int num, i, sum=1;
printf("Enter a number: ");
scanf("%d", &num);
for(i=1; i<=num; i++)
{
sum=sum*i;
}
printf("Factorial of %d is %d.", num, sum);
getch();
}