Skip to main content

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:

Comments

Popular posts from this blog

WAP to calculate the monthly telephone bills as per the following rule: Minimum Rs. 200 for upto 100 calls. Plus Rs. 0.60 per call for next 50 calls. Plus Rs. 0.50 per call for next 50 calls. Plus Rs. 0.40 per call for any call beyond 200 calls.

  #include<iostream.h> #include<conio.h> void main() { int calls; float bill; cout<<" Enter number of calls : "; cin>>calls; if (calls<=100) bill=200; else if (calls>100 && calls<=150) { calls=calls-100; bill=200+(0.60*calls); } else if (calls>150 && calls<=200) { calls=calls-150; bill=200+(0.60*50)+(0.50*calls); } else { calls=calls-200; bill=200+(0.60*50)+(0.50*50)+(0.40*calls); } cout<<" Your bill is Rs. "<<bill; getch(); }   Output: Enter number of calls : 190 Your bill is Rs.250

Write a program to calculate the total expenses. Quantity and price per item are input by the user and discount of 10% is offered if the expense is more than 7000.

  #include<iostream.h> #include<conio.h> void main() { int totalexp, qty, price, discount; cout<<" Enter quantity: "; cin>>qty; cout<<" Enter price: "; cin>>price; totalexp=qty*price; if (totalexp>7000) { discount=(totalexp*0.1); totalexp=totalexp-discount; } cout<<" Total Expense is Rs. "<<totalexp; getch(); }