Q. What is the output of the following code snippet? int x = 10; int &ref = x; ref = 20; cout << x;
β
Correct Answer: (B)
20
Explanation: The reference 'ref' modifies the value of x, so x becomes 20.