Flowcharts are nothing but the graphical representation of the data or the algorithm for a better understanding of the code visually. It displays step-by-step solutions to a problem, algorithm, or process. It is a pictorial way of representing steps that are preferred by most beginner-level programmers to understand algorithms of computer science, thus it contributes to troubleshooting the issues in the algorithm. A flowchart is a picture of boxes that indicates the process flow in a sequential manner. Since a flowchart is a pictorial representation of a process or algorithm, it’s easy to interpret and understand the process. To draw a flowchart, certain rules need to be followed which are followed by all professionals to draw a flowchart and is widely accepted all over the countries. Show Use of a flowchartFollowing are the uses of a flowchart:
When to use flowchartFlowcharts are mainly used in the below scenarios:
Types of FlowchartsThree types of flowcharts are listed below:
Types of boxes used to make a flowchartThere are different types of boxes that are used to make flowcharts. All the different kinds of boxes are connected to one another by arrow lines. Arrow lines is used to display the flow of control. Let’s learn about each box in detail. 1. Terminal This box is of an oval shape which is used to indicate the start or end of the program. Every flowchart diagram has this oval shape that depicts the start of an algorithm and another oval shape that depicts the end of an algorithm. For example: 2. Data This is a parallelogram-shaped box inside which the inputs or outputs are written. This basically depicts the information that is entering the system or algorithm and the information that is leaving the system or algorithm. For example: if the user wants to input a from the user and display it, the flowchart for this would be: 3. Process This is a rectangular box inside which a programmer writes the main course of action of the algorithm or the main logic of the program. This is the crux of the flowchart as the main processing codes is written inside this box. For example: if the programmer wants to add 1 to the input given by the user, he/she would make the following flowchart: 4. Decision This is a rhombus-shaped box, control statements like if, or condition like a > 0, etc are written inside this box. There are 2 paths from this one which is “yes” and the other one is “no”. Like every decision has either yes or no as an option, similarly, this box to have these as options. For example: if the user wants to add 1 to an even number and subtract 1 if the number is odd, the flowchart would be: 5. Flow This arrow line represents the flow of the algorithm or process. It represents the direction of the process flow. in all the previous examples, we included arrows in every step to display the flow of the program. arrow increases the readability of the program. 6. On-Page Reference This circular figure is used to depict that the flowchart is in continuation with the further steps. This figure comes into use when the space is less and the flowchart is long. Any numerical symbol is present inside this circle and that same numerical symbol will be depicted before the continuation to make the user understand the continuation. Below is a simple example depicting the use of On-Page Reference Advantages of Flowchart
Disadvantages of Flowchart
Sample ProblemsQuestion 1. Draw a flowchart to find the greatest number among the 2 numbers. Solution:
FlowChart: Question 2. Draw a flowchart to check whether the input number is odd or even Solution:
FlowChart: Question 3. Draw a flowchart to print the input number 5 times. Solution:
FlowChart: Question 4. Draw a flowchart to print numbers from 1 to 10. Solution:
FlowChart: Question 5. Draw a flowchart to print the first 5 multiples of 3. Solution:
FlowChart: |