QP School

Full Version: switch-case statement in C
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
int day = 3;
switch (day) {
    case 1:
        printf("Monday\n");
        break;
    case 2:
        printf("Tuesday\n");
        break;
    // ...
    default:
        printf("Invalid day\n");
}