#include<stdio.h>
#include<conio.h>
long factorial(long);
int main()
{
long f;
printf("Enter the Number for Factorial Calculation :?);
scanf("%ld",&f);
//factorial calculation
printf("The Factorial of %ld is %ld",f,factorial(f));
// Wait For Output Screen
getch();
//Main Function return Statement
return 0;
}
// factorial Function
long factorial(long n)
{
int counter;
long fact = 1;
//for Loop for Factorial Calculation Block
for (counter = 1; counter <= n; counter++)
{
fact = fact * counter;
}
return fact;
}