#include<stdio.h>
int fact(int);
main()
{
int n,temp;
printf("Enter a number\n");
scanf("%d",&n);
if(n>=0)
{
temp=fact(n);
printf("Factorial is %d",temp);
}
else
printf("Cannot find the factorial");
}
int fact(int c)
{
if(c==0)
return(1);
else
return(c*fact(c-1));
}
You Like It!? Then kindly share with your Friends.