C Program to Calculate the Factorial by Using Recursion

Write a program to calculate the factorial of entered number. Write a C program to calculate the factorial of entered number using recursion. C Program to calculate the factorial of number using function. C Program to Calculate Factorial of the Value.

Write a program to calculate the factorial of entered number.
Write a C program to calculate the factorial of entered number using recursion.
C Program to calculate the factorial of number using function.
C Program to Calculate Factorial of the Value.

C Code


#include<stdio.h>
#include<conio.h>
void main()
{
 int n; 
 int factorial(int);
 printf("Enter a number:");
 scanf("The factorial of %d is %d", n,factorial(n));
 getch();
}
int factorial(int n)
{
 if(n<1)
 return(1);
 else 
 return(n*factorial(n-1));
}

You May Also Like...

Socialize with Us