Bhuvan InfoTech Android App

Download our Android App and browse Technical News, Projects, Computer Tricks more easily with lots of Interesting Features.

Tuesday, June 14, 2016

Code to Find Factorial By Recursion | C program

#include<stdio.h>
int fact(int);

int main()
{
  int n;
  printf("Enter value to find factorial : ");
  scanf("%d",&n);
  n=fact(n);
  printf("\nFactorial is : %d ",n);
  return 0;
}

int fact(int x)
{
  if(x==1)
    return(x);
  else
   x=x*fact(x-1);
}
Bhuvan Arora

No comments:

Amazing Deal !