2.1 Algorithm and Flowchart
2.1 Algorithm and Flowchart
and
Flowchart
Devyani Soni
Department of Computer Science & engineering
Contents
Algorithm
Advantage and Disadvantage of algorithm
Flowchart
Advantage and disadvantage of flowchart
Algorithm vs. flowchart
Algorithm
Problem:
write an algorithm to read two numbers and find their sum.
Expected Output:
Sum of two numbers C
Algorithm:
Step 1: start.
Step 2: Read\ input the first num A.
Step 3: read\ input the second num B.
Step 4: C= A+B // calculation of sum
Step 5: print C.
Step 6: End
Types of Algorithm
1. Sequence
2. Branching(Selection)
3. Loop (repetition)
Advantage of algorithm
symbol name
Function
process
Input/
output
desicion
symbol name
Function
connectors
Predefined process
Terminal
Flow lines
Rules for flowcharting
start
Read A, B
C=A+B
Print c
end
Difference between
Algorithm and Flowchart
S. No Algorithm Flowchart
A flowchart is a diagram
An algorithm is a step-by-
created with different
1. step procedure to solve a
shapes to show the flow of
problem.
data.
A flowchart is just a
The algorithm is the pseudo-
7. graphical representation of
code for the program.
that logic.
End