I was given a question and was asked to give the output.
int main(void){
int x = 2;
switch(x){
case 1,2,1: printf(\"Case 1 is executed\
Turbo C uses comma operator on switch cases and takes the last value, for example case 1, 2, 3: will be compiled as case 3: case 2, 3, 1 as case 1: hence Turbo C will not give you any error. Where as other compilers will not allow you case 1, 2, 3: kind of statement itself.
But in your case even Turbo c will give error because case statements are something like this case 1, 2, 1: and case 3, 2, 1: which will be complied as case 1: and case 1: hence as per switch case rules you can have only 1 case with a value and you cannot repeat the case
I prefer to use gcc compiler rather Turbo C