Question

Consider a `Stack` data structure implemented with `push` and `pop` operations. What is the final state of the stack after the following sequence of operations?    ```     Stack s;     s.push(10);     s.push(20);     s.pop();     s.push(30);     s.push(40);     s.pop();     ```

A [10,20,30,40](bottom to top)
B [10,20,30](bottom to top)
C [10,30](bottom to top)
D [10,20,30](bottom to top)
Practice Next

Hey! Ask a query

🎓
Think You're Ready for RBI Grade B?
RBI Grade B 2026 Phase 1 Memory Based Paper
  • 200 Questions with Detailed Solutions
  • Section-wise Coverage (GA, English, Quant & Reasoning)