[ad_1]
int main(){
char c="a";
switch(c){
case 'a' && 1: printf("Hello");
case 'b' && 1: printf("hey");
break;
default : printf("Goodbye");
}
}
When I compile this code the result was “compilation error”, which (according to me) is because internally both the expression is true and hence for whatever character we take for “c”,the constant expression inside for both cases will always be true.
But now comes the doubt that I am not able to understand, how code in interpreted internally and how compiler actually interprets this code?
[ad_2]