Why does case 2 get evaluated twice in this for loop?
for (int x = 0; x <4; x++)
{
switch (x)
{
case 2: printf("%d", x);
case 0: printf("%d", x);
default: break;
case 3: printf("%d", x);
}
}
edit: I forgot to add that this is not a legitimate piece of code. Just something that came up in my friends job exam last week.