21232_algorithms and Flowchart
21232_algorithms and Flowchart
Definition of Algorithm:
Algorithm is the step-by-step procedure of solving a particular problem. It is simply a sequence of clear and precise
instructions for solving a particular problem. Algorithms are usually written in English and some few mathematical notation.
Characteristics of Algorithms
1. They are written in sequence
2. They are written in English like statements
3. Finite, it must have a beginning and an end
4. An Algorithm should be effective
5. It must be unambiguous and consistent.
Example of an Algorithm
An Algorithm to calculate Average of three numbers
Step 1: Enter the first number N1
Step 2: Enter the second number N2
Step 3: Enter the third number N3
Step 4: Calculate the total (N1 + N2 + N3)
Step 5: Calculate the Average (N1 + N2 + N3)/3
Step 6: Print total
Step 7: Print Average
Step 8: End.
Definition of Flowchart:
The flowchart is the diagrammatic representation of an algorithm. It shows the steps involved in solving a particular
task.
Characteristics of Flowchart:
1. Different flowcharting symbols are used for different operations
2. Flow lines are used to connect the flowcharting symbols
3. Flowcharts are read and drawn from top to bottom
4. The start symbol indicated the beginning of a program
5. The end symbol signifies the end of a program.
Flowcharting symbols:
1.
Process
It indicates any processing function.
2.
Terminator
Start / end Indicates the beginning or end of a program flow in your diagram.
3. Flow line
Indicates the connection between two or more flowchart symbols.
4.
decision
5. Indicates a decision point between two or more paths in a flowchart.
6. Preparation
7. Pre – defined
Indicates a predefined (named) process, such as subroutine or a module.
Process
8.
Input and
output Represents any type of data in a flowchart
Example of flowchart:
A flowchart to input and calculate three numbers and print total and average.
Start
Input first
number
Input second
number
Input third
number
Print Average
End