What does the following function do? int fun(int x, int y) { if (y == 0) return 0; return (x + fun(x, y-1)); }

What does the following function do?

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

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

More from this paper