ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
Which line would make the implementation complete?
Correct Answer: D — fibo(n - 1) + fibo(n - 2)
Consider the first five terms of the fibonacci sequence: 0,1,1,2,3. The 6th term can be found by adding the two previous terms, i.e. fibo(6) = fibo(5) + fibo(4) = 3 + 2 = 5. Therefore,the nth term of a fibonacci sequence would be given by:
fibo(n) = fibo(n-1) + fibo(n-2).