← All examples

Even / odd

C# Branching

if / else

Flowchart (ISO 5807)

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

Source code

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