Challenge: Recursive Powers
Write a recursive function power(x, n)
that returns the value of
1. Base Case
Start by writing the base case
2. Recursive case:
In this step, write the recursive case for which isOdd()
to check if
3. Recursive case:
In this step, write the recursive case for which isEven()
to check if
4. Recursive case:
In this step, write the recursive case for which
Create a free account to access the full course.
By signing up, you agree to Educative's Terms of Service and Privacy Policy