#include<stdio.h>
#include<conio.h>
long int fact(int x); // function prototype
void main()
{
long int m;
int n;
clrscr();
printf("ENTER THE NUMBER WHOSE FATORIAL IS NEEDED:");
scanf("%d",&n);
m = fact(n);
printf("THE FACTORIAL OF GIVEN NUMBER IS : %d ",m);
getch();
}
long int fact(int x)
{
int i;
long int fact;
fact = 1;
for (i=1; i<=x; i++)
{
fact = fact * i;
}
return (fact);
}