Searching...

Factorial of Given Number.

15:37

#include <iostream>
using namespace std;
int main()
{
int num,fact=1;
cout << "Enter Integer to get Factorial: ";
cin >> num;
/*cout << "Enter Length of the Table: ";
cin >> length;*/
for (int i=num;i>=1;i--)
{
fact=fact*i;
}
cout << "Factorial of " << num << " is = " << fact <<endl;
return 0;
}

0 comments:

Post a Comment

Thanks For Your FeedBack....