factorial of number using recursion
//using recursion to find factorial of a number
#include<stdio.h>
int fact(int n);
int main()
{
int n;
printf("Enter the number: ");
scanf("%d",&n);
printf("Factorial of %d = %d", n, fact(n));
}
int fact(int n)
{
if (n>=1)
return n*fact(n-1);
else
return 1;
}