Question: The following C switch compiles and executes, however it is printing all three messages: b is bigger than a a is bigger than b a

The following C switch compiles and executes, however it is printing all three messages:
b is bigger than a
a is bigger than b
a is equal to b
switch(a){
case 1: case 2:
printf(b is bigger than a
);
case 3: case 4: case 5:
printf(a is bigger than b
);
case 6: case 7: case 8:
printf(a is equal to b
);
}
What can we conclude?
The following C switch compiles and executes, however it is printing all three messages:
b is bigger than a
a is bigger than b
a is equal to b
switch(a){
case 1: case 2:
printf(b is bigger than a
);
case 3: case 4: case 5:
printf(a is bigger than b
);
case 6: case 7: case 8:
printf(a is equal to b
);
}
What can we conclude?
the value in variable b is bigger than the value in variable a.
the value in variable a is bigger than the value in variable b.
the value in variable a is equal to the value in variable b.
we cannot determine which variable, a or b, is bigger, or if they are equal.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!