Factorial of the given number
This is the program for find the factorial of the given number
Now you think given number is 5.
#include<stdio.h>
#include<string.h>
int fac(int a);
int main()
{
int fact;
fact = fac(5);
printf("factorials of 5 is %d",fact);
}
int fac(int a)
{
if(a<=1)
{
return 1;
}
else
{
a=a*fac(a-1);
return a;
}
}
Comments