```
```

```
/*Develop a ‘C’ program to compute the factorial of a given number using
recursion*/
#include
int fact(int x);
int main()
{
int n;
printf("\n Enter the number ");
scanf("%d",&n);
int res=fact(n);
printf("\n The factorial of the given number is %d",res);
return 0;
}
int fact(int x)
{
if(x==1)
return x;
else
return (x*(fact(x-1)));
}
```

### Like this:

Like Loading...

*Related*

[…] write a c program to find the factorial of the given number using recursion […]