Weekday/Weekend Classifier using Nested switch Dry Run in C

Weekday/Weekend Classifier using Nested switch is an interactive C dry run visualizer from the Switch programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

Weekday/Weekend Classifier using Nested switch Program Code

#include <stdio.h>

int main() {
    int day = 6;

    switch(day) {
        case 1: case 2: case 3: case 4: case 5:
            switch(1) {
                case 1: printf("Weekday"); break;
            }
            break;

        case 6: case 7:
            switch(1) {
                case 1: printf("Weekend"); break;
            }
            break;

        default:
            printf("Invalid day");
    }

    return 0;
}

View the complete Switch programs page.

Program Console Weekday/Weekend Classifier using Nested switch Topic: C Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.