Algorithm is a step – by – step procedure which is helpful in solving a problem. If, it is written in English like sentences then, it is called as ‘PSEUDO CODE’.
Properties of an Algorithm
An algorithm must possess the following five properties −
- Input
- Output
- Finiteness
- Definiteness
- Effectiveness
Example
Algorithm for finding the average of three numbers is as follows −
- Start
- Read 3 numbers a,b,c
- Compute sum = a+b+c
- Compute average = sum/3
- Print average value
- Stop
FLOW CHART
Diagrammatic representation of an algorithm is called flow chart.
Symbols used in flowchart are mentioned below −
Name | Symbol | Purpose |
---|---|---|
Terminal | ![]() | start/stop/begin/end |
Input/output | ![]() Parallelogram | Input/output of data |
Process | ![]() | Any processing to be performaed can be represented |
Decision box | ![]() | Decision operation that determine which of the alternative paths to be followed |
Connector | ![]() | Used to connect different parts of flowchart |
Flow | ![]() | Join 2 symbols and also represents flow of execution |
Pre defined process | ![]() | Module (or) subroutines specified else where |
Page connector | ![]() | Used to connect flowchart in 2 different pages |
For loop symbol | ![]() | shows initialization, condition and incrementation of loop variable |
Document | ![]() | Shows the data that is ready for printout |
Example
Given below is the flowchart for finding an average of three numbers −