#include <iostream>
usingnamespace std;
//Create Function Prototypes:
void iInput(int& num1, int& num2); //Used for the input of 2 integers
int MultiplyNumbers(int num1, int num2); //Used to Calculate the first to the power of the second and then output the result.
void DisplayTotal(); //Used to Display to then output the result
//Declare Variables:
int num1 = 0;
int num2 = 0;
int main() //main function
{
iInput(num1, num2); //Calls for input
DisplayTotal();
}//End main()
void iInput(int& num1, int& num2) //Function to take the 2 numbers from the user
{
// The input of the 2 numbers
cout << "Enter 2 numbers to get the power of the first to the second number: " <<endl;
cin >> num1 >> num2;
} //End iInput()
// Function to Calculate first # power with second number using a while loop
int MultiplyNumbers(int num1, int num2)
{
//declare variables
int totalexp = 1;
int i = 0;
while (i < num2) //if i does not equal the second number then go thru loop again
{
//multiple first user number the number of times the second number is to get the exponent and get a total
totalexp *= num1;
//checking the math
//cout << i << " Counter " << num1 << " Num1 " << num2 << " Num2 " << totalexp << " Total " << endl;
i = i + 1; //Add one to the counter i
}//end while
return totalexp; //return the total calculated in the loop
}//End multiplyNumbers()
// The output of the answer
void DisplayTotal() //Function to display the output
{
MultiplyNumbers(num1, num2); //provide the total for the power
//checking the math
//cout << "Numbers in display function " << num1 << " <= NUM1 " << num2 << " <= NUM2 " << endl;
cout << "Total is: " << MultiplyNumbers(num1, num2) << endl; //print the power
//Pause for output to be read
cout << "Press Enter to Continue";
cin.ignore();
cin.get();
} //End DisplayTotal()