Consider the function fun (x, y) below. What is the value of fun (4, 3)? int fun(int x, int y) { if (x == 0) return y; return fun(x - 1, x + y); }

Consider the function fun (x, y) below. What is the value of fun (4, 3)?

int fun(int x, int y) {
   if (x == 0)
      return y;
   return fun(x - 1, x + y);
}
  1. a) 13
  2. b) 12
  3. c) 9
  4. d) 10

From the Combined Bank Assistant Programmer (CSE) March 2021 – Preliminary exam, question 16 of 86.

More from this paper