Factorial of a number

Submitted by Karthikeyan on

C Program to find factorial of any number


#include 
main()
{
    int n;
	clrscr();
    printf("\n\t\t Factorial of Recursion");
	printf("\n\t\t **********************");
    printf("\n\n\t\t Enter the Number : ");
    scanf("%d",&n);
	printf("\n\n\t\t The value of n:%d",n);
    printf("\n\n\t\t The factorial of %d is %d ",n,fact(n));
	printf("\n\n\t\t**********************");
    getch();
}
fact(int m)
{
    int f;
    if(m==1)
    return(1);
    else
    f=m*fact(m-1);
    return(f);
}