Online Compiler C

#include <stdio.h> int main() { int day; scanf("%d", &day); switch(day){ case 1: printf("Monday\n"); break; case 2: printf("Tuesday\n"); break; case 3: printf("Wednesday\n"); break; case 4: printf("Thursday\n"); break; case 5: printf("Friday\n"); break; case 6: printf("Saturday\n"); break; case 7: printf("Sunday\n"); break; default: printf("Erro\n"); } return 0; }
1) This code reads an integer input representing a day of the week (1-7) and prints the corresponding day name, or "Erro" if the input is outside this range.

2) Hint: Check if the spelling of "Erro" matches the expected output requirement (should it be "Error"?).
Hint: Consider what happens if the user enters a decimal number or non-numeric input - scanf may not handle this as expected.