Assignment - 5 - Infix To Postfix

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Obtain the postfix notation for the following infix notation of expression

1. A * B + (C – D / F)
2. P + Q * (R-S) /T
3. A+B*(P+Q)**C/D
4. ((A+B) * C / D + E ** F ) / G
5. A * (B + (C+D) * (E+F)/ G ) * H
6. A + [(B+C) + (D+E) * F] / G
7. NOT A OR NOT B AND NOT C
8. ((A-B) * (D/E)) / (F * G * H)
9. (A+B **D ) / (E-F) + G
10. A * (B+D)/ E- F – (G + H / K)
11. (A+B) * C – D / E
12. NOT (A OR B) AND C
13. A + B * C **(D/E) / F
14. (A+B) * C + D / E – F
15. X- Y/ (Z+U) * V
16. U * V + R/ (S-T)
Evaluate the following postfix expression using stack and show the contents after execution
of each operation.
1. True, False, AND, True, True, NOT, OR, AND
2. 5,20,15, -, * ,25,2, *, +
3. 30,5,2, **,12,6,/,+,-,3
4. 470,5,4,**,25,/,6,*,+,81,-
5. 5 , 11 , - , 6 , 8 , + , 12 , * , /
6. 4, 10, 5, +, *, 15, 3, /, -
7. True,False,True,False,NOT,OR,True,OR,OR,AND
8. False,True, False, True, Not, Or, True, Or, Or, And
9. True, False, True, Not, False, True, Or, Not, And, Or, And
10. 16 , 2 , 6 , + , / , 2 , * , 1 , –
11. True, False, Not, Or, False, True, Or, And
12. True, False, Not, And, False, True, Or, And
13. True, False, Not, And, True, True, And, Or
14. 25, 8, 3, -, /, 6, *, 10, +
15. 10, 3, *, 7, 1, -, *, 23, +
16. 10, 20, +, 25, 15, - , *, 30, /
17. 5, 2, *, 50, 5, / , 5, -, +
18. T, F, NOT, AND, T, OR, F, AND

You might also like