Even or odd

    Last updated November 30, 2026

    Divide n by 2. A remainder of 0 means even. Any other remainder means odd. The chart is one decision. FlowSimp is completely free to use — no sign-up required.

    See the flowchart

    What does the flowchart look like?

    Ready to draw?

    No signup. Opens instantly in your browser.

    See the flowchart

    What is the matching code?

    Pseudocode

    read n
    if n is divisible by 2 then even
    else odd

    Python

    def even_or_odd(n):
        if n % 2 == 0:
            return "even"
        return "odd"

    C

    const char *even_or_odd(int n) {
      if (n % 2 == 0) return "even";
      return "odd";
    }
    • Zero is even, because 0 divided by 2 has remainder 0.
    • The diamond asks whether the remainder of dividing n by 2 is 0.