Challenge: Calculate the Power of a Number Recursively

Test your knowledge by solving a challenge in this lesson.

Problem statement

Your task is to write a recursive function power. In the function parameter, you will pass base and the exponent of type int and the function will return an int value in the output. It is assumed that only a non-negative value for the exponent will be used.

Get hands-on with 1200+ tech skills courses.