//Program to find the Factorial of number using Recursion function.
#include<stdio.h>
#include<conio.h>
int fact(int n);
void main()
{
int x,temp;
clrscr();
printf("\n \n enter the value of n: ");
scanf("%d",&x);
temp=fact(x);
printf("\n The value of the factorial is %d",temp);
getch();
}
int fact(int n)
{
int value;
if(n==1)
return(n);
else
{
value=n*fact(n-1);
return(value);
}
}
#include<stdio.h>
#include<conio.h>
int fact(int n);
void main()
{
int x,temp;
clrscr();
printf("\n \n enter the value of n: ");
scanf("%d",&x);
temp=fact(x);
printf("\n The value of the factorial is %d",temp);
getch();
}
int fact(int n)
{
int value;
if(n==1)
return(n);
else
{
value=n*fact(n-1);
return(value);
}
}