COS 102 · Problem Solving
Our notes
2 min readWhat a flowchart is
A flowchart is a diagram of an algorithm using standard shapes joined by arrows that show the order of steps. It is good for seeing the overall flow, especially decisions and loops.
Standard symbols
| Symbol | Shape | Use |
|---|---|---|
| Terminal | rounded rectangle (oval) | Start and Stop |
| Input/Output | parallelogram | read data, print results |
| Process | rectangle | calculations and assignments (Sum = Sum + X) |
| Decision | diamond | a yes/no question; two exits |
| Flow line | arrow | the order of steps |
| Connector | small circle | joins parts of a chart on the same page |
| Off-page connector | pentagon (home plate) | continues on another page |
| Predefined process | rectangle with double sides | a sub-procedure described elsewhere |
Three basic structures
- Sequence: one box after another.
- Selection (decision): a diamond with Yes and No paths that join again later.
- Repetition (loop): an arrow that goes back to an earlier point until a condition changes.
Any algorithm can be drawn with only these three (structured programming).
Worked example: pass or fail
Problem: read a score; print "Pass" if it is 40 or more, otherwise "Fail".
- Oval: Start.
- Parallelogram: Read SCORE.
- Diamond: SCORE ≥ 40?
- Yes → parallelogram: Print "Pass". No → parallelogram: Print "Fail".
- Both paths join → oval: Stop.
Trace: SCORE = 52 → Yes → "Pass". SCORE = 39 → No → "Fail". SCORE = 40 → Yes → "Pass" (the boundary case).
Worked example: sum of 1 to N
- Start. 2. Read N. 3. Set SUM = 0, I = 1.
- Decision: I ≤ N? No → go to step 7.
- Yes → SUM = SUM + I; I = I + 1.
- Arrow back to step 4.
- Print SUM. Stop.
Trace with N = 4: SUM becomes 1, 3, 6, 10; I becomes 5; 5 ≤ 4 is false; print 10. Check: 4 × 5 ÷ 2 = 10 ✓.
Rules for neat flowcharts
- One Start and one Stop.
- Flow from top to bottom, left to right.
- Every decision has exactly two labelled exits.
- Lines should not cross; use connectors.
- Keep the wording short.
Advantages and limits
Easy to understand and to explain to non-programmers; good for spotting logic errors. But large flowcharts become messy and are hard to change, which is why pseudocode is often preferred for long algorithms.
Exams usually ask
- Draw a flowchart for a given problem (largest of three numbers, sum or average, grading).
- Name and draw the standard symbols.
Common mistake
Using a rectangle for a decision or forgetting to label the Yes and No exits.
Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.
Read
-
Flowchart
(opens en.wikipedia.org in a new tab)
Wikipedia, Flowchart, CC BY-SA 4.0 · licence
-
Structured program theorem
(opens en.wikipedia.org in a new tab)
Wikipedia, Structured program theorem, CC BY-SA 4.0 · licence
-
NPTEL: Problem Solving through Programming in C (IIT Kharagpur, whole course)
Algorithms, flowcharts and pseudocode, then variables, decisions, loops, arrays and functions in C (the ideas carry over to Fortran and Python). Video lectures, many hours in all: watch on Wi-Fi where you can.
(opens nptel.ac.in in a new tab)
NPTEL, NPTEL: Problem Solving through Programming in C (IIT Kharagpur, whole course), CC BY-NC-SA 4.0 · licence
Watch
-
Best pick Creating Flowchart
3 min · ≈ 14 MB · about ₦8
(opens youtube.com in a new tab)
-
Flowchart tutorial
11 min · ≈ 50 MB · about ₦28
(opens youtube.com in a new tab)
-
Flow chart to psuedocode (computer)
7 min · ≈ 32 MB · about ₦18
(opens youtube.com in a new tab)
-
What is a Flowchart - Flowchart Symbols, Flowchart Types, and More
5 min · ≈ 23 MB · about ₦13
(opens youtube.com in a new tab)
-
An overview of flowcharts
4 min · ≈ 18 MB · about ₦10
(opens youtube.com in a new tab)
We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.