Language: C

#include <stdio.h>

char given_string[3];

int main() {
  scanf("%s", given_string);
  switch (given_string) {
    case "SUN":
      printf(7);
      break;
    case "MON":
      printf(6);
      break;
    case "TUE":
      printf(5);
      break;
    case "WED":
      printf(4);
      break;
    case "THU":
      printf(3);
      break;
    case "FRI":
      printf(2);
      break;
    case "SAT":
      printf(1);
      break;
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:11: error: switch quantity not an integer
    7 |   switch (given_string) {
      |           ^~~~~~~~~~~~
main.c:8:5: error: pointers are not permitted as case values
    8 |     case "SUN":
      |     ^~~~
main.c:9:14: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
    9 |       printf(7);
      |              ^
      |              |
      |              int
In file included from main.c:1:
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:11:5: error: pointers are not permitted as case values
   11 |     case "MON":
      |     ^~~~
main.c:12:14: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   12 |       printf(6);
      |              ^
      |              |
      |              int
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:14:5: error: pointers are not permitted as case values
   14 |     case "TUE":
      |     ^~~~
main.c:15:14: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   15 |       printf(5);
      |              ^
      |              |
      |              int
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:17:5: error: pointers are not permitted as case values
   17 |     case "WED":
      |     ^~~~
main.c:18:14: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   18 |       printf(4);
      |              ^
      |              |
      |              int
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:20:5: error: pointers are not permitted as case values
   20 |     case "THU":
      |     ^~~~
main.c:21:14: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   21 |       printf(3);
      |              ^
      |              |
      |              int
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:23:5: error: pointers are not permitted as case values
   23 |     case "FRI":
      |     ^~~~
main.c:24:14: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   24 |       printf(2);
      |              ^
      |              |
      |              int
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
main.c:26:5: error: pointers are not permitted as case values
   26 |     case "SAT":
      |     ^~~~
main.c:27:14: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   27 |       printf(1);
      |              ^
      |              |
      |              int
/usr/include/stdio.h:363:43: note: expected 'const char * restrict' but argument is of type 'int'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~