#include<iostream.h>
#include<conio.h>
void main()
{
long a,fact=1,i;
clrscr();
cout<<"enter the number";
cin>>a;
for(i=1;i<=a;i++)
{
fact*=i;
}
cout<<"the factorial of number is "<<fact;
getch();
}
#include<conio.h>
void main()
{
long a,fact=1,i;
clrscr();
cout<<"enter the number";
cin>>a;
for(i=1;i<=a;i++)
{
fact*=i;
}
cout<<"the factorial of number is "<<fact;
getch();
}
No comments:
Post a Comment