Question PSC-FUNC-0059
MediumWhat will be the output of the following pseudocode?
Function f(Integer n)
if (n == 1)
return 0
end if
if (n mod 2 == 0)
return 1 + f(n / 2)
end if
return 1 + f(n - 1)
End Function
Print f(15)
- A.
6
- B.
7
- C.
5
- D.
4
Sign up free to see the answer and a step-by-step explanation.