#include<stdio.h>
int main()
{
switch(2)
{
case 1:
if(1)
{
case 2:
printf("hello\n");
};
}
return 0;
}
OUTPUT = hello
as I'm passing 2
in switch
case 1
is not true then also it enters it and executes code inside case 2
.
How come it enters case 1
?
Thanks.