A modern compiler may be better than an older one when interpreting your code.
Also a different C compiler may compile your code differently than the one you are using.
If you mention your OS and compiler maybe some others could try your code out on in a different environment to see if you there is another answer.
In HP-UX 10.20 C the answer displayed is 2.
I would say that missing the 'break' in a C switch statement is employing a feature of the compiler, not the language. Even though I have used it myself in the past it could lead to problems in the future if the complier or OS was changed.
A similar trick in C is something like
if (flag)
{
/* do some stuff */
}
Here you are relying on the compiler to interpret the variable in a certain way. With compilers nothing is guaranteed and syntax like that in C could just as easily not work the way that you wan it to. Better to say exactly what you mean rather than imply:
if (flag == 1)
{
/* do some stuff */
}
C is a very powerful language precisely because it will almost let you get away with anything. Just as long as the syntax looks ok a compiler will produce any old executable. But it might not work though.
Remember YOU are the one doing the thinking, not the compiler
MBB