int fibo(int n)
{
if(n == 1)
return 0;
else if(n == 2)
return 1;
return fibo(n - 1) + fibo(n - 2);
}
int main()
{
int n = 5;
int ans = fibo(n);
printf("%d",ans);
return 0;
}
a) 5
b) 6
c) 8
d) 9
How many times will the function fibo() be called when the following code is executed?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
How many times will the function fibo() be called when the following code is executed?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!