Chapter 18: Problem 9
Write a recursive method power(base, exponent) that, when called, returns base \(^{exponent}\) For example, power \((3,4)=3^{*} 3^{*} 3^{*} 3 .\) Assume that exponent is an integer greater than or cqual to 1. \([\text {Hint: }\) The recursion step should use the relationship base \(^{exponent}\) = base base \(^{exponent - l}\) and the terminating condition occurs when exponent is equal to \(1,\) because base \(^{l}=\) base
Short Answer
Step by step solution
Key Concepts
These are the key concepts you need to understand to accurately answer the question.