//C Program

#include<stdio.h>
#include<conio.h>
void main()
{
int i,f=1,n;
clrscr();
printf("Enter a number for finding factorial \n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
f=f*i;
}
printf("Factorial is: %d",f);

getch();
}


//C++ Program

#include<iostream.h>
int main()
{
int i,f=1,n;
cout<<"Enter a number for finding factorial "<<endl;
cin>>n;
for(i=1;i<=n;i++)
{
f=f*i;
}
cout<<"Factorial is ::"<<f;

return 0;
}