Question PSC-FUNC-0022
EasyWhat will be the output of the following pseudocode?
Function f(Integer n)
if (n <= 1)
return 1
end if
return n * f(n - 1)
End Function
Print f(4)
- A.
16
- B.
120
- C.
Show answer and explanation
Answer: C
f is the factorial: 4 × 3 × 2 × 1 = 24.