Enumerate sample applications
enum week {Mon = 1, Tues, Wed, Thurs} day;
scanf("%d", &day);
switch(day) {
case Mon: puts("Monday"); break;
case Tues: puts("Tuesday"); break;
case Wed: puts("Wednesday"); break;
case Thursday: puts("Thursday"); break;
default: puts("Error!");
}
Comments