Question PSC-FUNC-0045
MediumWhat will be the output of the following pseudocode?
Function fib(Integer n)
if (n < 2)
return n
end if
return fib(n - 1) + fib(n - 2)
End Function
Integer i
for (each i from 5 to 8)
Print fib(i)
end for
- A.
5 8 13 21
- B.
5 8 12 20
- C.
Sign up free to see the answer and a step-by-step explanation.