To provide some practice, write a recursive power method that raises a base to some exponent, n. Use integers to keep things simple.
double power(int base, int n){
// Recursively determines base raised to
// the nth power. Assumes 0 <= n <= 10.
}
Last modified: December 12, 2022
Back to Pitfalls Of Recursion