Algorithm and Flowchart (Part 2)

Flowchart : Flowchart is a diagrammatic representation of an algorithm. We can also define flowchart as a graphical method to represent sequence of instructions required to perform specific task or to generate solution to a particular problem. Since it is a graphical method it makes use of various symbols they are as follow 

1) An oval  :  An oval symbol is also called as Start/Stop symbol. It is used to represent where algorithm starts from or where it is stopped.
   

2) An arrow :  An arrow symbol or pointed line is used to show sequence of steps or connection between different steps.


3) A parallelogram : Parallelogram is also called as input/output symbol. It is used to represent input accepted by algorithm or an output generated by algorithm.

4) A Rectangle : Rectangle symbol also called as process. It is used to represent process performed by an algorithm.


5) A Diamond : A diamond shape is also called as decision symbol. It is used to represent decision making statements based on particular condition.


Let's see some examples of flowchart. (Here we will see same examples as in previous section algorithm)

1) Draw a flowchart to display message "Good Morning " to user.

Solution  :





2) Draw a flowchart to computer addition of two integers.

Solution :


3) Draw a flowchart to calculate sum of first 'n' natural numbers.

Solution :


4) Draw a flowchart to  check whether a particular number is even or odd.

Solution:



5) Draw a flowchart to perform menu driven operations ( +, - , * , / ) on two integers. 

Solution:



Comments

Popular posts from this blog

Write a program to allocate memory dynamically for n integers. Accept the elements and calculate their sum and average

C program to accept names of n cities and search for city named “Pune”.