#include<conio.h>
#include<iostream.h>
void main()
|
clrscr();
int n, i;
unsigned
long f=1;
cout<<"Emter
the Number: ";
cin>>n;
if(n<=0)
cout<<"Please Enter valid number";
else
{
for (i=n; i>=1; i--)
{
f=f*i;
}
cout<<"Factorial of "<<n<<" =
"<<f;
}
getch();
}
No comments:
Post a Comment