A well-defined set of steps to provide a solution of a
An algorithm should have zero or more input.
An algorithm should exhibit at least one output.
An algorithm should be finite.
Each instruction in an algorithm should be defined clearly.
Each instruction used in an algorithm should be basic and easy
Representing an algorithm
A graphical tool representing the defined
solution of a problem.
Terminator – the first and last symbol in a flowchart
Input/Output – denote input/output
function of any input/output device
Process – indicate processing
Indicate flow of program
Decision – denote a decision-
making operation in a program
Connector – a link between parts of a
flowchart if a flowchart is large and
unfit in a single page
Rules for Drawing a Flowchart
It should contain only one starter and one end
The direction of arrows should be top to bottom
and left to right.
It should be simple and drawn clearly and
The branches of decision box must be labeled.
Advantages / Disadvantages
Provides convenient method to understand the solution.
Good tool for documentation.
Provide guide for coding.
Disadvantages / Limitations
Not suitable for large programs.
Complex logic: Sometimes, the program logic is quite
Alterations and Modifications: If alterations are required the
flowchart may require re-drawing completely.
from Fahrenheit to
Convert days into
months and days
Interchange the value
of two numbers
Read marks of 4 subjects, and print grade of the
student according to total marks obtained
Total Marks Grade
> 800 A
601 – 800 B
401 – 600 C
201 – 400 D
Check whether a
number is prime
flowchart to find the sum
of first 50 natural
find the largest of three
numbers A,B, and C.
Draw a flowchart to read a number N and print all its
Draw a flowchart for computing the sum of the digits of
any given number
Draw a flowchart to find the sum of given N numbers.
Draw a flowchart to computer the sum of squares of
integers from 1 to 50
Draw a flowchart to arrange the given data in an
http://media.en.kku.ac.th/188 110 Computer Programming
The Architecture of Computer Hardware and Systems
Software: An Information Technology Approach,
Linda Senne, Wilson Wong, Bentley College