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

PYQ GATE 2026

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 205 students.

Sign up free to check your answer

Sign up free

Explore the full course: Data Structures

Loading lesson…