#include<stdio.h>
#include<conio.h>
void main()
{
    int i,n,factorial;
    clrscr();

    printf(" Enter the number : ");
    scanf("%d",&n);

    factorial = 1;
    for(i=1; i<=n; i++)
    {
        factorial = factorial * i;
    }


    printf("\n Factorial of %d is %d",n,factorial );
    getch();
}

 

 OUTPUT:

Enter the number : 5
 
Factorial of 5 is 120