Algorithm and Flowchart
• Algorithm: Set of well-defined steps in a proper sequence to solve a particular problem.
• Example: Write an algorithm to add two numbers.
Step1 : Start
Step2: Input two numbers A,B .
Step3: Add A and B and store the result in C i.e. C=A+B
Step4: Display C
Step5: Stop.
• Flowchart: The graphical representation of steps of an algorithm. It uses various symbols each of
which has a specific meaning .
• Symbols of a Flowchart:
Symbol Name Function
Start/Stop Oval shape represents the beginning and
box end of a program.
Input /
Parallelogram represents the input and
Output
output of a program
Box
Process Rectangle represents the processing
Box instructions
Decision Diamond shape is used for decision
Box making
Arrows are used to connect the boxes
Flow
and show flow of control.
Lines
• Example : Draw a flow chart for adding two numbers.
• Points to remember when making a flowchart.
➢ Each flowchart should have a Start and Stop box.
➢ All the boxes should be connected with flow lines.
➢ Always mark the direction of the arrow to indicate the order of steps.
• Difference between Flow Chart and Algorithm.
Flowchart Algorithm
Step-by-step representation of a
1. Visual representation of a problem
problem.
Steps are written in simple English
2. Each step is displayed by a symbol.
language
3. Difficult to fix errors Fixing errors is comparatively easy.
Branching and looping can be Difficult to represent branching and
4.
illustrated easily looping