FIND FACTORIAL OF A NUMBER USING RECURSION IN C PROGRAM

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 :


  1. FIND FACTORIAL OF A NUMBER USING RECURSION IN C PROGRAM
  2. write a c program to find factorial of a number using recursion
  3. factorial of n numbers using recursion in c
  4. factorial without recursion in c
  5. write a c program to find factorial using recursive function
  6. c program to find fibonacci series using recursion
  7. program to find factorial of a number using recursion in java
  8. program to find factorial of a number using recursion in python
  9. factorial using recursion in java


Learn More :