Question:

Evaluate the postfix expression: \[ 24 \; 5 \; 7 \; \; 5 \; / \; + \]

Show Hint

For postfix evaluation: Push numbers, pop and compute on operators, repeat till end. Final stack value is the result.
Updated On: Sep 18, 2025
  • 29
  • 30
  • 31
  • 0
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Step 1: Recall rule of postfix evaluation.
Operands are pushed onto a stack. When an operator appears, the required number of operands are popped, operation performed, and result pushed back.
Step 2: Evaluate step by step.
Expression: \texttt{24 5 7 5 / +} - Push 24 → Stack = [24]
- Push 5 → Stack = [24, 5]
- Push 7 → Stack = [24, 5, 7]
- Operator → 5 7 = 35 → Stack = [24, 35]
- Push 5 → Stack = [24, 35, 5]
- Operator / → 35 / 5 = 7 → Stack = [24, 7]
- Operator + → 24 + 7 = 31 → Stack = [31]

Step 3: Final result.
Value = 31.
Final Answer: \[ \boxed{31} \]
Was this answer helpful?
0
0

Questions Asked in CUET exam

View More Questions