//Code to find the factorial of a given number
#include<conio.h>
#include<iostream.h>
void main()
{
int n;
unsigned long int f=1;
cout<<"enter a number";
cin>>n;
for(int i=1;i<n;i++)
{
f=f*i;
}
cout<<"factorial of "<<n<<"= "<<f;
getch();
}
//example factorial 5= 5*4*3*2*1=120