Language: C

#include<stdio.h>
int main(void) {
  int dayname;
  char dayname[10];
  scanf("%s",dayname);
    
  if(dayname == 'SUN') {
    printf(7);
  }
  else if (dayname == 'MON') {
    printf(6);
  }
  else if(dayname == 'TUE') {
    printf(5);
  }
  else if(dayname == 'WED') {
    printf(4);
  }
  else if(dayname == 'THU') {
    printf(3);
  }
  else if(dayname == 'FRI') {
    printf(2);
  }
  else if(dayname == 'SAT') {
    printf(1);
  }
  return 0;

}

Compiler output:
main.c: In function 'main':
main.c:4:8: error: conflicting types for 'dayname'; have 'char[10]'
    4 |   char dayname[10];
      |        ^~~~~~~
main.c:3:7: note: previous declaration of 'dayname' with type 'int'
    3 |   int dayname;
      |       ^~~~~~~
main.c:7:17: warning: multi-character character constant [-Wmultichar]
    7 |   if(dayname == 'SUN') {
      |                 ^~~~~
main.c:8:12: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
    8 |     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:10:23: warning: multi-character character constant [-Wmultichar]
   10 |   else if (dayname == 'MON') {
      |                       ^~~~~
main.c:11:12: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   11 |     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:13:22: warning: multi-character character constant [-Wmultichar]
   13 |   else if(dayname == 'TUE') {
      |                      ^~~~~
main.c:14:12: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   14 |     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:16:22: warning: multi-character character constant [-Wmultichar]
   16 |   else if(dayname == 'WED') {
      |                      ^~~~~
main.c:17:12: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   17 |     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:19:22: warning: multi-character character constant [-Wmultichar]
   19 |   else if(dayname == 'THU') {
      |                      ^~~~~
main.c:20:12: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   20 |     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:22:22: warning: multi-character character constant [-Wmultichar]
   22 |   else if(dayname == 'FRI') {
      |                      ^~~~~
main.c:23:12: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   23 |     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:25:22: warning: multi-character character constant [-Wmultichar]
   25 |   else if(dayname == 'SAT') {
      |                      ^~~~~
main.c:26:12: error: passing argument 1 of 'printf' makes pointer from integer without a cast [-Wint-conversion]
   26 |     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, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~