title: What does comma operator mean in a switch statement?
body: <p>I was given a question and was asked to give the output.</p>
  
  <pre><code>int main(void){  
      int x = 2;  
      switch(x){  
          case 1,2,1: printf("Case 1 is executed");  
              break;  
          case 2,3,1: printf("Case 2 is executed");  
              break;  
          default : printf("Default case us executed");  
      }  
      return 0;  
  }
  </code></pre>
  
  <p>The above code gives output as "Case 1 is executed" in Turbo C, But on codeblocks and compile online, it gives a compiler error.</p>
  
  <p>Which one is correct? Is it a compiler error or not? And if not, why does the code run only on Turbo C?</p>