Testwala logoTestwala
HomeMocksPracticePYQsDashboard
Testwala logoTestwala

Timing-accurate mock tests and PYQs for SSC, Banking and Railway exams — so the real paper feels like a revision.

Exams

  • SSC exams
  • Banking exams
  • Railway exams
  • All exams

Practice

  • Practice questions
  • Mock test series
  • Sectional tests
  • Year-wise PYQs
  • Performance analytics

Company

  • About us
  • Help Centre
  • Pricing
  • Sign in

Legal

  • Privacy Policy
  • Terms of Service

Contact

  • hello@testwala.co.in
  • Telegram
  • +91 62816 87760

Practice interface modeled on the official exam pattern — not the official examination. Testwala is not affiliated with the Staff Selection Commission, IBPS, SBI, RBI, NABARD, SEBI or Indian Railways.

© 2026 Testwala. All rights reserved.

Built for aspirants, by aspirants.

HomeMocksPracticeStats
  1. Home
  2. ›
  3. PYQs
  4. ›
  5. ibps-so
  6. ›
  7. 2023
  8. ›
  9. Q282

ibps-so 2023 · Question 282 of 323

What will be the output of the following C++ program? #include #include using namespace std; void insertBottom(stack & s, int x) { if (s.empty()) { s.push(x); return; } int t = s.top(); s.pop(); insertBottom(s, x); s.push(t); } void reverseStack(stack & s) { if (s.empty()) return; int t = s.top(); s.pop(); reverseStack(s); insertBottom(s, t); } void printStack(stack s) { while (!s.empty()) { cout s; s.push(34); s.push(25); s.push(58); s.push(96); s.push(12); reverseStack(s); cout << "Reversed Stack: "; printStack(s); return 0; }

  1. AReversed Stack: 12 96 58 25 34
  2. BReversed Stack: 34 25 58 96 12Correct
  3. CReversed Stack: 25 34 58 96 12
  4. DReversed Stack: 96 58 25 34 12
  5. ECompilation Error

Answer: B. Reversed Stack: 34 25 58 96 12

Official answer key verified. Detailed explanation coming soon.

Source: IBPS SO IT Officer Mains Memory Based 2023 (held 28 Jan 2024) - Adda247 · memory-based

← Q281View full paper (323 questions)Q283 →

Practice the full ibps-so 2023 paper

Timed test with all 323 questions, just like the real exam.

Start test