Diagram Desk

Even or odd flowchart

Uses the remainder after dividing by 2 to tell even from odd. The simplest branch: one decision, two paths, one end.

The diagram

StartRead integer nn mod 2 = 0 ?Print evenPrint oddEndyesno
Flowchart · 6 shapes

Reading it step by step

  • 1. Start at 'Start'.
  • 2. 'Read integer n' is an input or output. Next: 'n mod 2 = 0 ?'.
  • 3. Decide 'n mod 2 = 0 ?': if 'yes', go to 'Print even'; if 'no', go to 'Print odd'.
  • 4. 'Print even' is an input or output. Next: 'End'.
  • 5. End at 'End'.
  • 6. 'Print odd' is an input or output. Next: 'End'.

Shape by shape

ShapeSymbolConnections
StartTerminator→ Read integer n
Read integer nInput/output→ n mod 2 = 0 ? · ← Start
n mod 2 = 0 ?Decision→ Print even(yes), Print odd(no) · ← Read integer n
Print evenInput/output→ End · ← n mod 2 = 0 ?
Print oddInput/output→ End · ← n mod 2 = 0 ?
EndTerminator← Print even, Print odd

Symbols used here

SymbolMeaning
TerminatorWhere the flow starts or ends; a rounded rectangle.
DecisionA question whose answer picks the next path; a diamond.
Input/outputData comes in or goes out; a parallelogram.
Flow lineThe order of steps, in the arrow direction.

All flowchart symbols and how to draw

Diagram text

Paste this text into the editor to get the same picture, then change the names to fit your own work.

# Even or odd flowchart
flowchart TD
  s(["Start"])
  a[/"Read integer n"/]
  b{"n mod 2 = 0 ?"}
  c[/"Print even"/]
  d[/"Print odd"/]
  z(["End"])
  s --> a
  a --> b
  b -->|yes| c
  b -->|no| d
  c --> z
  d --> z

More flowchart examples

All SeewolLabs tools