# include <conio.h>
# include <iostream.h>int main()
{
long rt=1;
int fact;
cout <<"Enter the number for factorial: ";
cin >>fact;
for(int i=1;i<=fact;i++)
{
rt=rt*i;
}
cout<<"the Factorial of "<<fact<<" is: "<<rt;
getch();
return 0;}
# include <iostream.h>int main()
{
long rt=1;
int fact;
cout <<"Enter the number for factorial: ";
cin >>fact;
for(int i=1;i<=fact;i++)
{
rt=rt*i;
}
cout<<"the Factorial of "<<fact<<" is: "<<rt;
getch();
return 0;}
No comments:
Post a Comment