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....

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.