Computer AwarenessVery hardIBPS SO IT Officer · SSC CGL

An empty stack receives PUSH 5, PUSH 8, POP, PUSH 3, PUSH 9, POP, POP. What will the NEXT pop return?

  1. A. 8
  2. B. 3
  3. C. 9
  4. D. 5

Correct answer: D. 5

After PUSH 5, 8 the POP removes 8; PUSH 3, 9 then two POPs remove 9 and 3, leaving only 5. A stack is last-in, first-out.

हिंदी में

एक खाली स्टैक को PUSH 5, PUSH 8, POP, PUSH 3, PUSH 9, POP, POP मिलते हैं। अगला POP क्या लौटाएगा?

  1. A. 8
  2. B. 3
  3. C. 9
  4. D. 5

उत्तर: D. PUSH 5, 8 के बाद POP 8 हटाता है; फिर PUSH 3, 9 और दो POP 9 तथा 3 हटाते हैं, जिससे केवल 5 बचता है। स्टैक अंतिम-अंदर, पहला-बाहर (LIFO) होता है।

More Computer Awareness questions

Exams that ask this topic