Summary: Factorial is represented using '!', so
five factorial will be written as (5!),
n factorial as (n!).
n! = n*(n-1)*(n-2)*(n-3)...3.2.1
and zero factorial is defined as one i.e. 0! = 1.
int c, n, fact = 1;
printf("Enter a number to calculate it's factorial\n");
for (c = 1; c <= n; c++)
fact = fact * c;
printf("Factorial of %d = %d\n", n, fact);
Enter a number to calculate it's factorial
Factorial of 23 = 862453760