## Flow Charts

### Definition

A Flow Chart is a structurally ordered representation of how the different stages in a process are interconnected. Flow Charts diagrammatically represent algorithm(s) with the use of rectangle, oval, rhombus and other shapes.

### Introduction

‘Flow Chart’ is a commonly used methodology to represent the work flow of various processes. Flow charts are often used for representing procedures and also prove helpful in

1. Defining and analyzing processes in an algorithm
2. Eliminating ambiguity by defining proper flow areas

### Components of a Flow Chart

Flow Chart is usually created using various geometrical shapes which are interpreted in different ways:

1) Elongated Circle

This signifies ‘start’ or ‘end’ of the process.

Representation:

2) Rectangle

It signifies an ‘instruction’ or ‘action’

It is represented as:

3) Diamond

It signifies ‘decisions’ to be made’.

It is represented as:

4) Arrow

It signifies ‘Flow of control’.

It is represented as:

### Drawing flowcharts to represent an algorithm or a procedure

1. Write down the steps of the algorithm/procedure
2. Map the steps of the procedure to corresponding symbols or components of the flow chart.
3. Write some descriptive text within the components to make the flow chart self- explanatory.
4. Connect various components drawn with downward arrow, starting from first drawn components to last one.
5. Review the flowchart and try to increase the efficiency by removing redundancy within the flow chart.

### Example of Flowchart

Q. For an algorithm to find largest number from a given set of N positive inputs, draw a flowchart.

Ans: Algorithm

1. Let largest number, L = 0 and counter, n=0
2. Input a number ‘P’ from the user.
3. If P > L then store P in L and increment ‘n’. Else just increment ‘n’.
4. If ‘n’ is not equal to ‘N’ then take the user input ‘P’ again.
5. If n=N then print ‘L’.

Now the above steps uses three variables (L, n, P ) to implement the algorithm where

L – Keeps track of largest number
n – Keeps track of total of finite inputs
P – Lets input number from the user

Drawing the flow chart for the given problem is as follows:-

All the steps of the algorithm have been matched to draw its flow chart.