programming-examples/c++/Others/Multiply a number by a power.cpp

20 lines
323 B
C++
Raw Normal View History

2019-11-15 12:59:38 +01:00
Multiply a number by a power
#include <iostream>
using namespace std;
int main()
{
int number,power,count,i;
cout << "Enter Number: "; cin >> number;
cout << "Enter the power: "; cin >> power;
count = 1;
for (i=1; i <=power; i++)
count = count*number;
cout << count << endl;
return 0;
}