If you use the Linux gcc compiler, compile it with the -Wall option to verify this. Everything inside the case block, except for the “case case”, is never performed perfectly. But how it works in C / C ++, your answer largely depends on the type of compiler you use. The nut again, as I said above, int b=20 should never be reached, and therefore the result of the garbage value when printing it. A.
One more thing in such situations is good if you also tell us the type and version of your compiler in order to get more accurate answers.
source share