You already know that an
Think of it like a map of a journey. Each box is a place you pass through, and the arrows are the roads between them. Start at the top, follow the arrows, and you always know exactly where the algorithm goes next — and, crucially, where it splits when a decision has to be made.
Engineers, programmers and designers draw a flowchart before they write any code, because it is far quicker to spot a mistake in a picture than to hunt for it inside a program that is already running. Get the flowchart right, and the code almost writes itself.
Flowcharts use a small set of standard shapes, and everybody agrees on what each shape means. That is the whole point: because the shapes are standard, anyone in the world can read your flowchart without you explaining it. There are four you need to know:
Every one of these is joined to the next by an arrow, and the arrowhead always shows which way the flow goes. Follow the arrows and you are following the algorithm.
Let's draw a genuine algorithm — one that decides whether a number is even or odd. The trick is the remainder: divide the number by 2, and if nothing is left over the number is even. Step through the flowchart below one symbol at a time and watch how the four shapes fit together, ending with the decision diamond that splits the flow two ways.
Notice the shape of it: everything funnels down to the diamond, the flow splits into a Yes road and a No road, and then both roads join back together and arrive at the single END. That "split, then re-join" pattern is the heart of almost every useful flowchart.
To trace a flowchart is to pretend you are the computer: start at the top and walk the arrows, answering each decision as you reach it. Let's trace our even/odd chart twice.
Trace
Trace
Same flowchart, two different numbers, two different routes — but every route reaches the end. That is exactly what a well-drawn flowchart guarantees.
A numbered list is perfect while an algorithm marches straight down the page. But the moment it has to branch — do one thing if a test passes and a different thing if it fails — a list gets clumsy ("go to step 7", "skip to step 12"…) and easy to get lost in. A flowchart shows the branch as an actual fork in the road, so the two possibilities sit side by side where you can see both at once. That is why flowcharts are the go-to tool for anything with decisions in it.
A flowchart isn't just a drawing — it maps almost line-for-line onto real code. The diamond becomes an
Read the flowchart and the code side by side and you can point to each symbol in the drawing and find the matching line in the program. Draw first, then code — the flowchart is the plan.
A decision diamond follows strict rules, and beginners often break them: