Question PSC-FUNC-0069
HardWhat is the output of this pseudocode?
Integer calls = 0
Function f(Integer n)
calls = calls + 1
if (n <= 2)
return 1
end if
return f(n - 1) + f(n - 3)
End Function
Integer v = f(7)
Print v, calls
- A.
9 17
- B.
13 17
- C.
Sign up free to see the answer and a step-by-step explanation.