Question 6Asked in UGC NET Computer Science, December 2014 (Paper II & III, Selected Questions)

Convert the following infix expression into its equivalent post fix expression

Convert the following infix expression into its equivalent post fix expression (A + B^D)/(E – F) + G
  1. AABD^ + EF –/G+
  2. BABD+ ^EF –/G+
  3. CABD+ ^EF/ –G+
  4. DABD^ + EF /–G+
Show answerHide answer

Correct answer: (A) ABD^ + EF –/G+

Explanation

^ has the highest precedence, so B^D becomes BD^, and A + B^D becomes ABD^+. E – F becomes EF–. Dividing gives ABD^+EF–/, and adding G gives ABD^+EF–/G+.

From UGC NET Computer Science PYQ, December 2014 (Paper II & III, Selected Questions)

This is question 6 of UGC NET Computer Science PYQ, December 2014 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.