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);
}From the Combined Bank Assistant Programmer (CSE) March 2021 – Preliminary exam, question 16 of 86.
More from this paper
- Previous: To implement Dijkstra's shortest path algorithm on unweighted graphs so that it runs in linear time, the data structure to be used is-
- Next: What does the following function do? int fun(int x, int y) { if (y == 0) return 0; return (x + fun(x, y-1)); }
- All questions in Combined Bank Assistant Programmer (CSE) March 2021 – Preliminary