Q. What is the output of the following C++ code?
int a = 7;
cout << a >> 1;
int a = 7;
cout << a >> 1;
β
Correct Answer: (B)
3
Explanation: The '>>' operator is the right shift operator. Shifting 7 by 1 bit results in 3.