I was doing the quiz on this website dealing with Switch Case and I have a question. Question 4 states
The answer is D. Why is it D? I understand there is no break statement but for it to execute case 2 the value of x would need to be 2 but its 0. Why is Hello World getting outtputted when the case value is not met?Code:4. What is the result of the following code? x=0; switch(x) { case 1: cout<<"One"; case 0: cout<<"Zero"; case 2: cout<<"Hello World"; } A. One B. Zero C. Hello World D. ZeroHello World