Q. What is the output of the following code snippet? int x = 10; int y = 20; cout << (x >>= 1);
β
Correct Answer: (A)
5
Explanation: The compound assignment operator (>>=) shifts the bits of x to the right by 1, effectively dividing x by 2. So, x becomes 5.