πŸ“Š C++
Q. What is the output of the following code snippet? int x = 10; int &ref = x; ref = 20; cout << x;
  • (A) 10
  • (B) 20
  • (C) 0
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 20

Explanation: The reference 'ref' modifies the value of x, so x becomes 20.

Explanation by: Vikash Gupta
The reference 'ref' modifies the value of x, so x becomes 20.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
108
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Vikash Gupta
Publisher
πŸ“ˆ
83%
Success Rate