Question: FULL JAVA CODE PLEASE Write a recursive function named powerTo that accepts two integers representing a base and a power and returns the base raised

FULL JAVA CODE PLEASE

Write a recursive function named powerTo that accepts two integers representing a base and a power and returns the base raised to that power.

For Example:

powerTo(2, 3) -> 8

powerTo(3, 3) -> 27

powerTo(3, 4) -> 81

Do not use loops or auxiliary data structures; solve the problem recursively.

NOTE: You may not use Math.pow() to solve this question

Input

 x y, where x and y are positive Integer values. 

Sample Input

 2 3 

Output

 The value of 2 to the power of 3 

Sample Output

 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!