At Westonci.ca, we provide clear, reliable answers to all your questions. Join our vibrant community and get the solutions you need. Connect with a community of experts ready to help you find solutions to your questions quickly and accurately. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform.

What is the result of the following code?
int x = 1;
switch(x)
{
case 1: printf( "Help" );
case 0: printf( "Me" );
break;
case 2: printf( "Hello World" );
}
A. HelpMe
B. Help
C. Help Me
D. Hello World


Sagot :

Answer:

B: Help

Explanation:

During the execution of this switch statement, it will print "Help" because that's the only case that matches the value of x, it will not print "Me" because that case does not match, so it will fall through that case into the break statement.