//Factorial of a number using Recursion
#include<stdio.h>
#include<conio.h>
int fact(int no);
main()
{
int no,ans;
printf("Enter any number:");
scanf("%d",&no);
ans=fact(no);
printf("Factorial of a number is:%d",ans);
getch();
}
int fact(int x)
{
int f;
if(x==0)
{
return 1;
}
else
{
f=x*fact(x-1);
return f;
}
}
Enter any number:12
Factorial of a number is:479001600