/*PROGRAM TO FIND FACTORIAL OF A NUMBER USING RECURSION*/
#include<stdio.h>
#include<conio.h>
int fact(int);
void main()
{
int n,f;
clrscr();
printf(“Enter number whose factorial is to be calculated:”);
scanf(“%d”,&n);
if(n>0)
{
f=fact(n);
printf(“factorial of %d is %d”,n,f);
}
else
printf(“Factorial of numbers less than 1 does not exist”);
getch();
}
int fact(int n)
{
int facto=1;
if(n>1)
facto=n*fact(n-1);
else
return 1;
return(facto);
}