Write a function called integerPower(base,exponent) that returns the value ofbaseexponent
For example,
integerPower(3,4) = 3*3*3*3
- Assume that exponent is a non-zerointeger, and base is an integer.
- Function integerPower should use forloop to control the calculation.
- Do NOT use any math library function.
- Inputs for this program, which arebase andexponent, have to be entered by theuser
An example of input/output dialog is shown below:
Enter Integer Base: 5Enter Integer Exponent: 35 raised to the power of 3 = 125Enter 0 if you'd like to end this program.Enter 1 if you'd like to run this program again: 1Enter Integer Base: 2Enter Integer Exponent: 42 raised to the power of 4 = 16Enter 0 if you'd like to end this program.Enter 1 if you'd like to run this program again: 0Have a nice day!