Question: Write a program that uses a recursive function to raise a number to a power. The function should accept two arguments: the base (or number
Write a program that uses a recursive function to raise a number to a power. The function should accept two arguments: the base (or number to be raised and the exponent). Create a main function that asks the user for the base, and the exponent. Use input validation to ensure that the exponent is between 2 and 50 inclusive. (Both the base and the exponent can be integers). You cannot use the exponent operator (**) or predefined function/method for this question. Sample output is shown below: Enter the base: 2 Enter a whole number between 2 and 50: 1 Invalid. Please enter a whole number between 2 and 50: 4 2 raised to the power of 4 is 16
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
