// Demonstration of enum // // Date: 22/09/2024 #include // Define an enum with days of the week // make sure it is outside and before the main function // MON will have value 0, TUE 1, WED 2, etc enum weekdays {MON, TUE, WED, THU, FRI, SAT, SUN}; enum spring_months {SEP, OCT, NOV}; int main(void) { enum weekdays day; day = SEP; // What will this print out? printf("The day number is %d\n", day); if (day == MON) { printf("Monday"); } else if (day == TUE) { printf("Tuesday"); } else if (day == WED) { printf("Wednesday"); } else if (day == THU) { printf("Thursday"); } else if (day == FRI) { printf("Friday"); } else if (day == SAT) { printf("Saturday"); } else if (day == SUN) { printf("Sunday"); } else { printf("Unknown weekday"); } printf("\n"); return 0; }