The postfix form of the expression (A+B)∗(C∗D−E)∗F/G, is –
2022
The postfix form of the expression (A+B)∗(C∗D−E)∗F/G, is –
- A.
AB+CD*E-FG/**
- B.
AB+CD*E-F**G/
- C.
AB+CD*E-*F*G/
- D.
AB+CDE*-*F*G/
Attempted by 443 students.
Show answer & explanation
Correct answer: C
To convert the infix expression (A+B)*(C*D−E)*F/G to postfix, follow the operator precedence and associativity rules.
Step 1: Process (A+B). Addition has lower precedence than multiplication, so it becomes AB+.
Step 2: Process (C*D−E). Multiplication has higher precedence than subtraction, so C*D becomes CD*, then CD*E−.
Step 3: Multiply (A+B) and (C*D−E). This gives AB+CD*E−*.
Step 4: Multiply by F. This gives AB+CD*E−*F*.
Step 5: Divide by G. This gives AB+CD*E−*F*G/.
Final postfix expression: AB+CD*E−*F*G/.