Question: 3. Given the following C program. int fib(int n) { int y1, y2; if (n = 1) return n; else { y1 = fib(n
3. Given the following C program. int fib(int n) { int y1, y2; if (n = 1) return n; else { y1 = fib(n - 1); //ra2 = y2 fib(n-2); return y1 y2; //ra3 } } int main() { int number; } printf("Enter an integer: "); scanf("%d", &number); printf("The corresponding Fibonacci number is %d ", fib(number)); return 1; Suppose the main function calls fib(4). Draw the call tree of the execution.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
