Factorial

 #include<iostream>

using namespace std;

int main()

{

int num, sq = 1, temp;

cout << "Program For Calculate The Factorial Of A Number." << endl;

cout << "Enter Number :  ";

cin >> num;

temp = num;

for (int i = 0; i < num; i++)

{

sq = sq * temp;

temp--;

}

cout << "Factorial Of A Number Is : " << sq << endl;

system("pause");

return 0;

}

Comments

Popular Posts