Program for Finding Factorial of a given number using Recursion
https://www.computersprofessor.com/2016/06/program-for-finding-factorial-of-given.html?m=0
#include<stdio.h>
#include<conio.h>
fact ( int n);
main( )
{
int n, r;
printf (“enter a value “);
scanf (“/d”,&n);
r=fact(n);
printf (“factorial is % d “,r);
}
fact ( int n)
{
If (n==1)
return 1;
else
return ( n*fact (n–1));
}
Out
Put:
Enter n value 5
Factorial is 120