Challenge: Calculate the nth Fibonacci Number using Recursion

Test our knowledge by solving a challenge in this lesson.

Problem statement

In this challenge, your task is to calculate the nth Fibonacci number in the Fibonacci series.

You have to write a recursive function fibonacci. In the function parameter, you will pass the value of type int, and the function will return a value of type int. It is assumed that only a non-negative value for the parameter n will be used.

Get hands-on with 1400+ tech skills courses.