Consider the recursive function for calculating the nthFibonacci number: int fib
ID: 3611170 • Letter: C
Question
Consider the recursive function for calculating the nthFibonacci number:
int fib(int n) {
if (n == 0)
return 0;
else if (n == 1)
return 1;
else
return fib(n-1) + fib(n-2);
}
(b) In what situations will thefunction terminate? How do you know that it will terminate inthose circumstances?