#include<iostream.h>
#include<conio.h>
int main()
{
int n, f, i;
clrscr();
cout<<"Enter a number=";
cin>>n;
f=1;
for(i=1;i<=n;i++)
{
f=f*i;
}
cout<<"\nThe factorial of the number "<<n<<" is "<<f;
getch();
}
#include<conio.h>
int main()
{
int n, f, i;
clrscr();
cout<<"Enter a number=";
cin>>n;
f=1;
for(i=1;i<=n;i++)
{
f=f*i;
}
cout<<"\nThe factorial of the number "<<n<<" is "<<f;
getch();
}
No comments:
Post a Comment