Write a program to find the factorial of given number using recursion



//function for calculating factorial
int fact(int n)
if(n==0 || n==1)
return n;
return n*fact(n1);

//Driver function
int main()
int n;
printf(“Enter a numbern”);
printf(“FActorial of the number is: %d”,fact(n));
return 0;


Enter a number
Factorial of the number is: 120

Leave a Reply

Your email address will not be published.