Find Factorial Of Number Using Recursion

#include<stdio.h>

int fact(int);

int main()
{

   int factorial, num;

   printf("Enter the value of num :\n");
   scanf("%d", &num);  //input from user

   factorial = fact(num);
   printf("Factorial is %d\n", factorial);   //Print Output On screen

}

int fact(int num)
{
if(num==0)
{
return 1;
}

else return fact*(fact-1);
}

Related Posts