Challenge: Weekend or Weekday

Lab C Beginner 10 points

Define enum Day { MON = 1, TUE, WED, THU, FRI, SAT, SUN };. Read a day number (1–7) and print weekend if it is SAT or SUN, otherwise weekday.

Input

One integer from 1 to 7.

Output

weekend or weekday.

Example

Input

6

Output

weekend
Sample input available Sample output available
Editor
C

Hints

MON = 1 makes the following names 2, 3, ... 7.

Compare d with SAT and SUN.

Solution explanation

The enum names make the condition read like plain English.

Show solution
#include <stdio.h>

enum Day { MON = 1, TUE, WED, THU, FRI, SAT, SUN };

int main() {
    int d;
    scanf("%d", &d);
    if (d == SAT || d == SUN) {
        printf("weekend\n");
    } else {
        printf("weekday\n");
    }
    return 0;
}
Output
Answer
HOME LABS COMMUNITY DASHBOARD