Unit 1 - I Algorithms and Flowcharts v1.5
Unit 1 - I Algorithms and Flowcharts v1.5
Table of Contents
1. Algorithm 3
1.1 Pseudo code 3
2. Flowchart 4
2.1 Basic notations used in a flow chart 4
1. Algorithm
Def 1: Step-by-step procedure to solve a problem using a computer is called an algorithm.
Def 2: In Computer Science, A finite sequence of unambiguous steps to solve a problem is
called an algorithm.
2. Flowchart
Def: Pictorial representation of an algorithm is known as flowchart.
⇨ It represents the flow of execution of instructions in an algorithm by a computer,
using graphical notations.
⇨ Need to study various symbols or pictures used to represent an algorithm as a flow
chart.
2 Stop:
3: Input/Output Operations:
4: Processing:
7. Flow line:
8. Connector:
Flowchart:
Exercise 1: Write the algorithm and flowchart for computing the area of a circle.
S
tep 1: Start
S
tep 2: Input 3 sides of the triangle into a,b,c.
Step 3: Compute s= (a+b+c)/2
tep 4: Compute area = 𝑠 × (𝑠 − 𝑎) × (𝑠 − 𝑏) × (𝑠 − 𝑐)
S
S
tep 5: Display value of area
Step 6: Stop
3.9
Algorithm and Flowchart for finding factorial of given
number
1. Start
2. Input the value of n
3. Initialize i = 1, prod =1
4. Repeat the steps as long as i<=n
a. prod = prod *i
b. i = i+1
5. Display factorial value prod
6. Stop.
Flowchart: