Question PSC-FUNC-0007
EasyWhat will be the output of the following pseudocode?
Function p(Integer b, Integer e)
if (e == 0)
return 1
end if
return b * p(b, e - 1)
End Function
Print p(3, 4)
- A.
12
- B.
81
- C.
27
- D.
64
Show answer and explanation
Answer: B
p computes b to the power e: 3⁴ = 81.