Question 5 Evaluate the postfi x expression a b c Assume t
Question 5 Evaluate the postfi x expression a b – c +. Assume the following values for
 the identifi ers: a = 7, b = 3, and c = –2. Show the status of the stack after each step.
Solution
Given expression: a b - c +.
After inserting values:
7 3 - (-2) +
Therefore, the result of evaluating the postfix expression is: 2.
| Current Element | Stack | 
| 7 | 7 | 
| 3 | 7, 3 | 
| - | 4 | 
| -2 | 4, -2 | 
| + | 2 | 
| - | 

