#include <stdio.h>
int
factorial (int n)
{
int ans;
if (n == 0)
ans = 1;
else
ans = n * factorial(n - 1);
return (ans);
}
int
main (void)
{
int a, result;
printf ("Enter an integer number: ");
scanf ("%d", &a);
/* calling the function */
result = factorial (a);
/* printing the report */
printf ("The factorial of %d is %d.\n", a, result);
return (0);
}