Wednesday, February 22, 2012

Flowcharts in Programming

Flowchart
Flowchart is the graphical representation of an algorithm. It is used to show all the steps of an algorithm in a sequence pictorially. An algorithm may be converted to a flowchart. The flowchart is then converted into a program written in any programming language.
Advantages of Flowcharts
Flowchart is used for the following reasons:
1.    Flowchart represents an algorithm in graphical symbols.
2.    It shows the steps of an algorithm in an easy way.
3.    It is used to understand the flow of the program.


Flowchart Symbols
Following are the symbols used in Flowchart
1.    Start/End
Oval symbol is used to represent the start or end of the flowchart.


2.    Input/Output
Parallelogram symbol is used to represent an input or output step.


3.     Process
Rectangle symbol is used to represent a process step. A process may be a calculation or assignment etc.


4.     Selection 
Diamond symbol is used to represent a selection step. A condition is given in the diamond. If condition is true then flow of control will go in one direction. If condition is false then control will go in other direction.


5. Flow Lines    
Arrow symbols are used to represent the direction of flow in the flowchart. There are four types of flow lines.


6. Connector 
Circle symbol is used to combine different flow lines.


Examples:
Example 1
Develop a flowchart to Enter any  two numbers and calculate its sum and then display the result.

f1
Example 2
Develop a flowchart to Enter any five numbers and calculate its average and then display the result
.
f2
Visit These Articles:
c1
C++ Progarm
c2
C++ Program
niitindrapuri.blogspot.com      
Technorati Tags:

Reactions:

0 comments:

Post a Comment

You might also like:-

Google+ Followers