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:3:21: error: expected ';' before 'int'
    3 | char given_string[3]
      |                     ^
      |                     ;
    4 | 
    5 | int main() {
      | ~~~                  
main.c: In function 'main':
main.c:6:15: error: 'given_string' undeclared (first use in this function)
    6 |   scanf("%s", given_string);
      |               ^~~~~~~~~~~~
main.c:6:15: note: each undeclared identifier is reported only once for each function it appears in
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: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: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: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: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: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: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, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~