What is the value of the postfix expression 9 3 / 2 ^ 1 + , where ^ means exponentiation?
Correct answer D. 10
Explanation
Push 9 and 3; / gives 9 / 3 = 3. Push 2; ^ gives 3 squared = 9. Push 1; + gives 9 + 1 = 10. Postfix needs no brackets or precedence rules because each operator applies immediately to the top two stack values, with the lower one as the left operand. Getting 19 would mean the operators were applied in the wrong order.
Answer checked How we write and check questions
Discussion