Which of the following infix expressions is obtained on converting the postfix…
2018
Which of the following infix expressions is obtained on converting the postfix expression
A B - C + D E F - + $
- A.
A - B + C + D $ E - F
- B.
A - B + C $ D + E - F
- C.
A - B $ C + D + E - F
- D.
A + B - C $ D + E - F
Attempted by 96 students.
Show answer & explanation
Correct answer: B
The correct option is B. We evaluate the postfix expression A B - C + D E F - + $ step-by-step using a stack. Operands are pushed onto the stack, and operators combine them:
A B -becomes(A - B)(A - B) C +becomes(A - B + C)D E F - +becomes(D + (E - F))Finally,
$combines them into(A - B + C) $ (D + E - F), which matches Option B without unnecessary parentheses.