GateAI
Stacks

GATE CSE 2015 Set 3 · Q12

MCQ1 markEasy

Time

The result evaluating the postfix expression 10 5+60 6 /∗8−10 \ 5 + 60 \ 6 \ / * 8 - is

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) 142

Stacks

To evaluate the postfix expression 10 5+60 6 /∗8−10 \ 5 + 60 \ 6 \ / * 8 -, we scan the tokens from left to right using a stack:

  1. Push 1010: Stack =[10]= [10]

  2. Push 55: Stack =[10,5]= [10, 5]

  3. Operator +: Pop 55 and 1010, compute 10+5=1510 + 5 = 15, push 1515. Stack =[15]= [15]

  4. Push 6060: Stack =[15,60]= [15, 60]

  5. Push 66: Stack =[15,60,6]= [15, 60, 6]

  6. Operator /: Pop 66 and 6060, compute 60/6=1060 / 6 = 10, push 1010. Stack =[15,10]= [15, 10]

  7. Operator *: Pop 1010 and 1515, compute 15×10=15015 \times 10 = 150, push 150150. Stack =[150]= [150]

  8. Push 88: Stack =[150,8]= [150, 8]

  9. Operator -: Pop 88 and 150150, compute 150−8=142150 - 8 = 142, push 142142. Stack =[142]= [142]

The final result is 142.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Stacks previous year question is Q12 of the GATE CSE 2015 Set 3 paper. Find more GATE CSE PYQs on Stacks in Programming and Data Structures, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 3 related Stacks PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Stacks in GATE CSE

Stacks has 3 GATE CSE PYQs across 3 papers from 2015 to 2025. This is the only 1-mark MCQ among them, and it is the only one in GATE CSE 2015 Set 3.

How GATE tests Stacks

More from GATE CSE 2015 Set 3

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2015 Set 3 · Q12 · MCQ

The result evaluating the postfix expression 10 5 + 60 6 / * 8 - is

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.