Reading other people's flowcharts is one of the fastest ways to learn Flowgorithm. The eight Flowgorithm examples below follow the order most courses teach topics in. For each one you'll find what it teaches, which shapes it needs and the logic written out so you can rebuild it yourself.

New to the program? Start with the first-program tutorial and return here afterwards.

1. Greeting: pure sequence

Teaches: String variables, input and joining text. Shapes: Declare, Output, Input, Output.

Declare String name
Output "What is your name?"
Input name
Output "Hello, " & name

The & operator joins text. Try removing the space after the comma to see why spacing inside strings matters.

2. Area of a circle: Real numbers

Teaches: Real variables and arithmetic. Shapes: Declare ×2, Input, Assign, Output.

Declare Real radius, area
Input radius
Assign area = 3.14159 * radius ^ 2
Output "Area: " & area

If you declare area as an Integer instead, Flowgorithm will object to storing a decimal in it — a useful lesson about types.

3. Even or odd: the remainder operator

Teaches: a single If and the modulo operator. Shapes: Declare, Input, If, Output ×2.

Input n
If n mod 2 = 0
    Output "Even"
Else
    Output "Odd"

You can write the remainder as mod or %, depending on the operator style you prefer.

4. Largest of three: nested decisions

Teaches: nested If shapes and the logical AND operator. Shapes: Declare, Input ×3, If ×2, Output ×3.

If a >= b and a >= c
    Output a
Else
    If b >= c
        Output b
    Else
        Output c

Draw it first on paper — nested diamonds become wide quickly, and seeing the shape of the logic is half the point.

5. Count from 1 to 10: the For loop

Teaches: counted repetition. Shapes: Declare, For, Output.

Declare Integer i
For i = 1 to 10
    Output i

Change the step value to count in twos, or count backwards from 10 to 1 to see how the loop variable behaves.

6. Running total until zero: the While loop

Teaches: sentinel-controlled loops and accumulators. Shapes: Declare ×2, Assign, Input, While, Assign, Input, Output.

total = 0
Input x
While x != 0
    total = total + x
    Input x
Output "Total: " & total

Notice the Input appears twice: once before the loop and once at the end of each pass. Leave out the second one and the loop never ends.

7. Average of five marks: arrays

Teaches: declaring and filling an array, then processing it. Shapes: Declare (array), For ×2, Input, Assign, Output.

Declare Integer marks[5]
For i = 0 to 4
    Input marks[i]
sum = 0
For i = 0 to 4
    sum = sum + marks[i]
Output sum / 5

Flowgorithm arrays are zero-based, so a five-element array uses indexes 0 to 4. Asking for marks[5] is a classic out-of-range error.

8. Factorial: functions and recursion

Teaches: user-defined functions with return values, and recursion. Shapes: a new function with If and Assign; a Call or expression in Main.

Function factorial(Integer n) returns Integer
    If n <= 1
        result = 1
    Else
        result = n * factorial(n - 1)
    Return result

Flowgorithm keeps an internal call stack, so if you forget the base case it stops with an error message instead of crashing the program — a forgiving way to learn recursion.

Where to find more examples

  • The project's documentation page includes example programs you can open directly in Flowgorithm.
  • Roberto Atzori's collection is a large community repository of Flowgorithm programs, available in English and Italian; the official download page points to it.
  • Course textbooks that use Gaddis pseudocode pair well with Flowgorithm, since it can output that pseudocode style.
  • Community repositories on code-hosting sites — see our Flowgorithm GitHub guide for how to evaluate them.

How to study an example

  1. Predict the output before you press Run.
  2. Step through it with the Variable Watch window open.
  3. Change one thing — a condition, a starting value — and predict again.
  4. Open the Source Code Viewer and find the line that matches each shape.