GATE DA 2025 · Question 63 · Programming, Data Structures and Algorithms · Numerical answer (NAT) · 2 marks · no negative marks

Consider the following Python code snippet.
def f(a,b): if (a==0): return b if (a%2==1): return 2*f((a-1)/2,b) return b+f(a-1,b) print(f(15,10))
The value printed by the code snippet is ______ (Answer in integer)

Answer

Answer 160

Answer from the official GATE DA 2025 answer key.

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