Flowcharts
What is a Flowchart?
Think of a flowchart as a roadmap or a picture guide for a computer program.
- An algorithm uses step-by-step words, but a flowchart is a visual (graphical) representation of that algorithm using standard shapes and arrows.
- Why use it? It helps programmers spot mistakes (bugs) in their logic before they start writing actual code. If something is wrong, it's much easier to fix it on a drawing than inside a complex program!
Symbols Used in Flowcharts
To draw a flowchart, we use specific geometric shapes. Each shape has a special meaning:
- Terminal (Oval): Shows the Start or Stop / End of the flowchart.
- Input / Output (Parallelogram): Used when getting data from the user or printing the result.
- Processing (Rectangle): Used for doing math calculations or data updates.
- Decision (Diamond): Used when the program needs to make a choice (like True/False or Yes/No). It has one entrance and two exits.
- Flow Lines (Arrows): Lines with arrowheads that connect the blocks and show the direction of execution.
- Connectors (Circle): Used to connect sections of a flowchart if it spans multiple parts of a page.
Examples of Flowcharts
Example 1: Sum of Elements in an Array
This flowchart visually loops through a list of numbers, adds them up one by one, and displays the total sum.
Example 2: Computing the Factorial of a Number
It follows a loop where numbers are multiplied sequentially
Example 3: Greatest of Three Distinct Numbers
This flowchart uses decision (diamond) boxes to compare three numbers against each other step-by-step to find and display the largest one.
Example 4: Sum of Series (1 + 2 + 3 + ... + 100)
This uses a counter loop starting from 1 up to 100, accumulating the total sum step-by-step until the condition finishes, and then prints the result.
Try it Yourself 👍
Test your understanding by trying to draw a flowchart for these simple problems on a piece of paper:
- Draw a flowchart to check whether a given number is Even or Odd.
- Draw a flowchart to find the Area of a Circle (Formula: Area = π × r × r).
- Draw a flowchart to check if a person is Eligible to Vote (Age ≥ 18).









