Quiz | on Fibonacci Numbers | Question 10

Last Updated :
Discuss
Comments

What should be the base condition for the below recursive code?

C++
int fib(int n) {         //Base condition      return fib(n - 1) + fib(n - 2); } 

if(n>=1) return 0;

if(n<=1) return 0;

if(n< 1 ) return n;

if(n<=1) return n; 

Share your thoughts in the comments