Question from the Algorithmics - Fundamentals test

Write a function that returns the nth Fibonacci number.

Medium

The Fibonacci sequence is a sequence of integers such that each term is the sum of the two previous ones and begins with a 1. How should the following code be modified to make it work? :

function fibonacci(n) 
{
     return fibonacci(n-1) + fibonacci(n-2);
}
      display fibonacci(10);

Author: KahinaStatus: Published(Update)Question passed 100 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!