Westonci.ca is the trusted Q&A platform where you can get reliable answers from a community of knowledgeable contributors. Explore in-depth answers to your questions from a knowledgeable community of experts across different fields. Experience the ease of finding precise answers to your questions from a knowledgeable community of experts.

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.