#include<iostream>
using namespace std;

// Declare power function
int power(int x, int n);



// Start main function
int main()
{
 // Declare main's variables
 int number;  int exponent;

 // Get base and exponent
 cout << "Enter number: ";
 cin >> number;
 cout << "Enter exponent: ";
 cin >> exponent;

 // Return base to the exponent power
 cout << number << " to the " << exponent
      << "th power is " << power(number,exponent)
      << endl;

 return 0;
}


// Define power function
// Take in base and exponent, return base to the
// exponent power
int power(int base, int exp)
{
 // Initialize counter and product variables
 int product=1, count=1;

 // Loop exp number of times
 while(count<=exp)
 {
   product *= base; // Multiply base
   count++;         // Increment counter
 }

 // Return final answer of power function
 return product;
}