FIND FACTORIAL OF A NUMBER USING RECURSION IN C PROGRAM
Solution:
#include<stdio.h>
int main(){
int num,f;
printf("\nEnter a number: ");
scanf("%d",&num);
f=fact(num);
printf("\nFactorial of %d is: %d",num,f);
return 0;
}
int fact(int n){
if(n==1)
return 1;
else
return(n*fact(n-1));
}
More C Program :
- FIND FACTORIAL OF A NUMBER USING RECURSION IN C PROGRAM
- write a c program to find factorial of a number using recursion
- factorial of n numbers using recursion in c
- factorial without recursion in c
- write a c program to find factorial using recursive function
- c program to find fibonacci series using recursion
- program to find factorial of a number using recursion in java
- program to find factorial of a number using recursion in python
- factorial using recursion in java