Consider the recursive functions represented by the following code segment:…

GATE · 2026 · CS · Set 1 · Computer Science & IT

Consider the recursive functions represented by the following code segment:

image.png

The smallest positive integer n for which foo(n) returns 5 is ______. (answer in integer) Note: Ignore syntax errors (if any) in the function.

Attempted by 164 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…