Flowchart Updated 12/2/2026

Switch Case Flowchart

Switch case flowchart: one value is compared with each case in turn, the first match runs its action and then breaks out, and the default catches everything else. With a trace for day = 2 and tested C, Java and Python code.

switch caseflowchartselectioncontrol flowprogramming
10 nodes 12 connections

Study guide

Switch Case FlowchartStartRead dayday == 1?Print "Monday"day == 2?Print "Tuesday"day == 3?Print "Wednesday"Print "Invalid day"EndYesNoYesNoYesNo (default)breakbreakbreak
Switch Case Flowchart. Source: https://www.chartcraft.dev/examples/switch-case-flowchart

What the switch case flowchart shows

A switch statement compares one value against a list of cases and runs the action of the first case that matches. In a switch case flowchart each case is a diamond in a ladder, each Yes arrow runs one action and then jumps to the end (that jump is the break), and the last No arrow lands on the default.

The example turns a day number into a day name: 1 is Monday, 2 is Tuesday, 3 is Wednesday, and anything else is invalid.

Switch case flowchart, step by step

  1. terminator StartOne Start terminator opens the flowchart.
  2. input/output Read dayReads the value being switched on. Every diamond below tests this same variable.
  3. decision day == 1?Case 1. Yes runs the Monday action. No drops down to the next case.
  4. input/output Print "Monday"The action for case 1. Its arrow goes straight to End: that is break.
  5. decision day == 2?Case 2, tested only when case 1 did not match.
  6. input/output Print "Tuesday"The action for case 2, followed by break.
  7. decision day == 3?Case 3, the last labelled case.
  8. input/output Print "Wednesday"The action for case 3, followed by break.
  9. input/output Print "Invalid day"The default case. It runs when no case matched, like the final else of an if-else chain.
  10. terminator EndEvery path meets here. A switch always has exactly one exit point.

Dry run: trace table for day = 2

Follow the flowchart with day = 2. Each row is one shape the flow reaches.

StepShapedayTestPrintedNext shape
1Read day2no testnothingday == 1?
2day == 1?22 == 1: Nonothingday == 2?
3day == 2?22 == 2: YesnothingPrint "Tuesday"
4Print "Tuesday"2no testTuesdayEnd

Case 3 and the default are never reached. As soon as one case matches, break skips everything below it.

Switch case pseudocode

Pseudocode
READ day
CASE day OF
    1: PRINT "Monday"
    2: PRINT "Tuesday"
    3: PRINT "Wednesday"
    OTHERWISE: PRINT "Invalid day"
ENDCASE

Switch case in Python, C and Java

Python
day = int(input())

# Python 3.10+ has match, its version of switch.
match day:
    case 1:
        print("Monday")
    case 2:
        print("Tuesday")
    case 3:
        print("Wednesday")
    case _:              # default
        print("Invalid day")
C
#include <stdio.h>

int main(void) {
    int day;
    scanf("%d", &day);

    switch (day) {
        case 1:
            printf("Monday\n");
            break;
        case 2:
            printf("Tuesday\n");
            break;
        case 3:
            printf("Wednesday\n");
            break;
        default:
            printf("Invalid day\n");
    }
    return 0;
}
Java
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int day = in.nextInt();

        switch (day) {
            case 1:
                System.out.println("Monday");
                break;
            case 2:
                System.out.println("Tuesday");
                break;
            case 3:
                System.out.println("Wednesday");
                break;
            default:
                System.out.println("Invalid day");
        }
    }
}
Input typed at the keyboard
2
Output of all three programs
Tuesday

All three programs were compiled and run with the input 2 before publishing. Python has no switch keyword; match (Python 3.10 and later) does the same job and never falls through, so it needs no break.

Mistakes examiners see most

  • Leaving out break in C or Java. Without break the flow falls through into the next case's action. With day = 2 and no breaks, the program prints Tuesday, Wednesday and Invalid day. In the flowchart, a missing break means the action's arrow points to the next action instead of End.
  • Drawing one diamond with many exits and no labels. Some books allow a single diamond with one exit per case, but every exit must be labelled with its value. The ladder of yes-or-no diamonds shown here is the safest answer in an exam.
  • Forgetting the default. Without a default, an input like 9 prints nothing and the reader cannot tell why. The default is the switch version of the last else.
  • Using switch for ranges. A C or Java case compares for exact equality, so case marks >= 50 is not allowed. Ranges need an if-else chain.

Practice questions with worked answers

Q1 In the C program, the break after case 2 is deleted. What is printed for day = 2?

Tuesday and then Wednesday.

Case 2 matches and prints Tuesday. With no break, the flow falls into case 3's action and prints Wednesday. The break after case 3 then stops it, so Invalid day is not printed.

Q2 How many diamonds does the flow pass through for day = 7, and what is printed?

Three diamonds, and it prints Invalid day.

7 fails day == 1, day == 2 and day == 3 in turn, so the last No arrow leads to the default.

Q3 Rewrite the switch as an if-else chain in pseudocode.
Pseudocode
READ day
IF day == 1 THEN
    PRINT "Monday"
ELSE IF day == 2 THEN
    PRINT "Tuesday"
ELSE IF day == 3 THEN
    PRINT "Wednesday"
ELSE
    PRINT "Invalid day"
ENDIF

The flowchart is the same picture. That is why a switch case flowchart looks like an else-if ladder.

Flowchart symbols used and why

SymbolShape to draw on paperWhere it appears hereWhy
TerminatorRounded boxStart and EndAll four paths meet at the one End.
Input/outputParallelogramRead day and the four Print stepsThey take input or show output.
DecisionDiamondday == 1?, day == 2?, day == 3?One diamond per case, each with labelled Yes and No exits.
Flow lineArrowThe arrows labelled breakA break is just an arrow that jumps past the remaining cases to End.

In the interactive diagram every step is a labelled card: the small word above each step names its kind (process, decision or data). When you draw this flowchart by hand, use the standard shapes in the table. The full list is on the flowchart symbols page.

Make your own version

Each link opens the editor with a prompt already filled in. Change the wording, then generate your own flowchart.

How can I use this flowchart?

Download the Switch Case Flowchart as a PNG or SVG, or open it in the studio to edit your own copy. To draw a similar flowchart from a description, use the flowchart generator; for notation and a step-by-step walkthrough, read how to make a flowchart; and browse more flowchart examples for related layouts.

Try the studio with your own description.

Type any system, process, or schema in plain English. ChartCraft will draw it in seconds.