# include <stdio.h>
int fact(int n)
{
if (n<=1)
return 1;
else
return fact(n-1)*n;
}
int main()
{
int n;
printf ("Enter any number");
scanf("%d", &n);
printf ("factorial= %d", fact(n));
return 0;
}
Enter any number5
factorial= 120
--------------------------------
Process exited after 3.031 seconds with return value 0
Press any key to continue . . .