Solution
#include<iostream>using namespace std;
int main()
{
// Variable declarations.
int x, y, i, power;
i = 1;
power = 1;
cout << "Enter base as an integer: ";
cin >> x;
cout << "Enter exponent as an integer: ";
cin >> y;
while( i <= y)
{
power *= x;
++i;
}
cout << power << endl;
system("pause");
}
0 Questions:
Post a Comment