GATE | GATE-CS-2016 (Set 2) | Question 47
Consider the following program:
Note: max(x,y) returns the maximum of x and y. The value printed by this program is
After the last recursive call f(1016,1) returns, in the previous call we will have return max(0,2) and then return max(2,-4) and then return max(2,3) and then finally return max(3,-2) = 3.
This solution is contributed by Pranjul Ahuja