Skip to content

switch-expression

C# C# switch

Flowchart (ISO 5807)

YesNoYesNoStartInput nn = 0Return «нуль»Endn = 1Return «один»EndReturn «багато»EndFigure 1 — Program.Size

Source code

C#
class Program {
    static string Size(int n) {
        switch (n) {
            case 0: return "нуль";
            case 1: return "один";
            default: return "багато";
        }
    }
}

The editor opens with this code — change it and the chart redraws.

Language
C#
Constructs
C# switch
Topic
Switch / case
Formats
Word, Visio, draw.io, PDF, SVG

Related examples