The postfix expression for * + ab - cd is.
2017
The postfix expression for * + ab - cd is.
- A.
ab+cd-* / ab+cd-*
- B.
ab +-cd / ab +-cd
- C.
ab +cd - / ab +cd -
- D.
ab +cd- / ab +cd-
Attempted by 794 students.
Show answer & explanation
Correct answer: A
Correct Answer: ab+cd-*
Explanation:
Interpret the expression as * ( + a b ) ( - c d ).
Convert the left subexpression + a b to postfix: a b +.
Convert the right subexpression - c d to postfix: c d -.
Combine left postfix, right postfix, then the root operator *: a b + c d - * which gives ab+cd-*.
Therefore the correct postfix expression is ab+cd-*.