Flowchart
Flowchart is the graphical representation of flow of data. It
is similar to algorithm. Each type of process is represented with a specific
symbol in flowchart. Flowchart shows the processes of a problem solving
pictorially.
The symbols used in flowchart are given below:
Advantages of Flowchart:
·
Easy detection of errors.
·
Easily understand flow of control of the program.
·
It becomes easier to understand a complex program
·
It is a suitable tool to explain the solution to a
problem to others clearly.
Flowchart may be developed for various programming constructs
Flowchart for sequential statements: the flow of data is in simple steps involving calculations.
1. Flowchart to add two numbers
1. Flowchart
to find product of two numbers
Conditional statements: These are the decision making statements. Flow of data depends on conditions and based on that the statements are executed.
1. Flowchart
to find the largest number from three given numbers .
1. Flowchart
to find whether a given number is even or odd.
![](https://4.bp.blogspot.com/-NGbl6dvS0vI/W0B1dLCFCNI/AAAAAAAADvk/Sz7SSWrZcus6ucHNWN5YWZGIDqqJ6MnaACEwYBhgL/s320/DECISION2.png)
Looping statements: Some statements are repeated and
are also known as iterative statements.Loops can be finite or infinite.
Finite loops : These loops run for a specific number of times and
stop when a certain condition is met. For example :
Flowchart to display first n
numbers.
Infinite loops : The statements
within a loop keep executing and never end. The terminating condition is never
true in such loops. Example :
Flowchart below display natural numbers
and will never end as the value of condition variable never changes.
No comments:
Post a Comment