switch(2){case 2:cout<<"X"; case 3:cout<<"Y"; break;} prints
Q.switch(2){case 2:cout<<"X"; case 3:cout<<"Y"; break;} prints
A) Y
B) nothing
C) X
D) XY
Correct Answer:
Option D
Detailed Explanation:
D) XY is correct. switch performs multi-way selection using integral or enum-like values such as int and char. Case labels are constants; break exits the switch, while missing break can cause fall-through.