fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. char d = 0;
  5. switch(d) {
  6. case '0' + '1':
  7. printf("I am case 'a' + 'b'\n");
  8. break;
  9. case '0' + '1':
  10. printf("I am case 'a' + 'b' \n");
  11. break;
  12. }
  13. return 0;
  14. }
  15.  
Compilation error #stdin compilation error #stdout 0s 9296KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:9:5: error: duplicate case value
     case '0' + '1':
     ^~~~
prog.c:6:5: error: previously used here
     case '0' + '1':
     ^~~~
stdout
Standard output is empty