Skip to content

Even / odd

C# if / else

Flowchart (ISO 5807)

YesNoStartInput nn mod 2 = 0Return «парне»EndReturn «непарне»EndFigure 1 — Program.Parity

Source code

C#
class Program {
    static string Parity(int n) {
        if (n % 2 == 0)
            return "парне";
        else
            return "непарне";
    }
}

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

Language
C#
Constructs
if / else
Topic
Branching
Formats
Word, Visio, draw.io, PDF, SVG

Related examples