GATE CS 2020 · Question 56 · Programming and Data Structures · Numerical answer (NAT) · 2 marks · no negative marks

Consider the following C functions.
int fun1(int n) { static int i = 0; if (n > 0) { ++i; fun1(n-1); } return(i); } int fun2(int n) { static int i = 0; if (n > 0) { i = i + fun1(n); fun2(n-1); } return(i); }
The return value of fun2(5) is ______.

Answer

Answer 55

Answer from the official GATE CS 2020 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes