Flowchart runner: follow six classic flowcharts box by box with a trace table

Pick a flowchart (even or odd, largest of three, add 1 to n, Euclid's HCF, leap year, steps to 1), type the inputs and follow it one box at a time. The current box lights up, the arrow taken is marked, and a trace table records every variable. Ends with predict-the-output questions.

Keep it one tap away for everyday use.

Bookmark Flowchart runner?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Pick chart
  2. Inputs
  3. Step
  4. Trace
Nothing is uploadedWorks offline once open

Pick a flowchart

Follow it

Trace table

Every box visited so far, with the variables after it. Tracing like this is how programmers check an algorithm by hand.

The shapes

  • Rounded box: Start or Stop.
  • Slanted box: input (read a value) or output (say a result).
  • Rectangle: a process: work something out. "s ← s + i" means "s becomes s + i".
  • Diamond: a decision, a yes-or-no question with two arrows out.

Try this

  • Add 1 to n with n = 5: how many times is the diamond visited? Now try n = 10. Can you predict it without running?
  • Leap year with 1900, 2000 and 2024. Why must "400 divides y?" come before "100 divides y?"
  • Largest of three with a = b = c = 7. Which path does it take? Is the answer still right?
  • Steps to 1 with n = 27. It climbs past 9 000 before falling back to 1.

Check yourself

Run the chart in your head (or on paper) and type what it says. Nothing is saved.

What it does

A flowchart is an algorithm drawn as a picture: boxes for the steps and arrows for the order. This page has six classic flowcharts that you can run with your own numbers, one box at a time:

  • Even or odd: one decision, two paths.
  • Largest of three: decisions inside decisions. Two questions always find the biggest.
  • Add 1 to n: a loop. The arrow goes back up to the diamond until the answer to “i ≤ n?” is no.
  • Euclid’s HCF: the same loop idea, replacing (a, b) by (b, a mod b) until b is 0.
  • Leap year: a chain of questions where the order matters (divisible by 400, then by 100, then by 4).
  • Steps to 1: halve even numbers, triple and add 1 to odd ones, and count the steps (the famous Collatz question, still unproved).

As you step, the current box lights up, the arrow just taken is highlighted, the variables are shown, and a trace table records every box visited with the variables after it. That table is exactly what you would write by hand to check an algorithm.

It fits the Class 9 mathematics chapter on algorithms (step-by-step methods and flowcharts). To watch sorting and searching step by step, see the algorithm stepper; Euclid’s algorithm is drawn as factor trees and a Venn picture in HCF and LCM.

How to use it

  1. Choose a flowchart from the list. A line under it says what it shows.
  2. Type the inputs (whole numbers). The run is worked out at once and sits at the Start box.
  3. Press Step to move one box, Back to go back, Play to run it on its own, or To the end to jump to Stop.
  4. Watch the variables and the output, and scroll the trace table.

The shapes: a rounded box is Start or Stop, a slanted box is input or output, a rectangle is a process (“s ← s + i” means “s becomes s + i”), and a diamond is a yes-or-no decision.

A worked example

Add 1 to n with n = 5. After Start and “Read n”, the process box sets s = 0 and i = 1. The diamond asks “i ≤ n?”: 1 ≤ 5, yes, so s becomes 1 and i becomes 2, and the arrow goes back up. This repeats for i = 2, 3, 4 and 5, making s = 3, 6, 10 and 15. When i = 6 the answer is no, so the chart says 15 and stops. The diamond was visited 6 times (5 yes and 1 no), and the whole run is 21 boxes.

Euclid’s HCF with 168 and 60: (168, 60) → (60, 48) → (48, 12) → (12, 0), so it says 12. Leap year with 1900: 400 does not divide it, but 100 does, so it says not a leap year, even though 4 divides 1900.

Check yourself

Four fresh questions each time: the output of “Add 1 to n”, how many times its diamond is visited, the output of Euclid’s HCF, and the number of steps to 1 for a small number. Work them out in your head or on paper, then run the chart to check. Nothing is saved.

FAQ

Why does the leap-year chart ask about 400 first? Every year divisible by 400 is also divisible by 100. If the 100 question came first, 2000 would wrongly be called “not leap”.

What happens with a negative n in “Add 1 to n”? It needs n from 0 to 200 on this page. With n = 0 the diamond says no straight away and the output is 0.

Is this from the NCERT book? It covers the same topic with fibub’s own charts and examples. fibub is not part of NCERT.

Where the numbers come from

  • Flowchart symbols and the six algorithms (parity, maximum of three, sum of 1 to n, Euclid's algorithm, the Gregorian leap-year rule and the Collatz sequence) are standard. Wording, charts and examples are fibub's own.
  • Checked against Python: n(n+1)/2, math.gcd, calendar.isleap, max() and Collatz step counts for 1 to 1000.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Change log for Flowchart runner

  1. Add #1293 Flowchart runner Details on GitHub

Every change to fibub

Related tools

HCF and LCM #L72 Type two numbers and watch their prime factor trees grow. Shared primes land in the middle of a Venn picture to give the HCF; all of them give the LCM. Euclid's division steps and the HCF × LCM check are shown too. Venn diagram calculator #L89 Type any set expression with union, intersection, complement and difference for 2 or 3 sets and see the region shaded on a Venn diagram. Compare two expressions to check De Morgan's laws, put in real lists of elements, and count with n(A ∪ B) = n(A) + n(B) − n(A ∩ B). Algorithm stepper #L168 Watch bubble sort put a list in order, binary search halve a sorted list to find a number, and Euclid's algorithm cut a rectangle into squares to find the HCF. Step forwards and back, count the comparisons, and see how the step counts grow from 8 items to a million. Quadratic explorer #L68 Slide a, b and c and watch the parabola move: vertex, roots and the discriminant update live, completing the square is drawn with tiles, and the middle term is split for you. With fresh practice questions. Pythagoras proof playground #L69 Drag a right triangle and watch the squares on its sides add up. Slide through four visual proofs (rearrangement, Bhaskara, similar triangles, Baudhayana) with your own side lengths, and list Pythagorean triples. Trig ratio explorer #L70 Drag the angle of a right triangle and see sin, cos and tan as ratios of its sides, with the exact values at 0°, 30°, 45°, 60° and 90°, the identities checked live, and the full unit circle for Class 11.