Question

What is the output of the following C++ code? #include     using namespace std; int main() {     int x = 5;     int &ref = x;     ref = 10;     int *ptr = &x;     *ptr += 5;     cout << x << " " << ref;     return 0; }

A 10 10
B 15 10
C 15 15
D 10 15
E 5 15
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)