How to Write a Flowchart That Will Make Your Algorithm Sing
In branch control, there is a condition and according to a condition, a decision of either TRUE or FALSE is achieved. In the case of TRUE, one of the two branches is explored; but in the case of the FALSE condition, the other alternative is taken.
How to Write a Flowchart That Will Make Your Algorithm Sing
- A flowchart is a diagrammatic representation of an algorithm.
- A flowchart can be helpful for both writing programs and explaining the program to others.
- Programmers often use it as a program-planning tool to solve a problem.
- The process of drawing a flowchart for an algorithm is known as “flowcharting”.
WHAT IS ALGORITHM?
- An algorithm is a set of well-defined instructions in sequence to solve a problem.
CRITERIA FOR A GOOD ALGORITHM:
- Input and output should be defined precisely.
- Each step in the algorithm should be clear and unambiguous.
- Algorithms should be the most effective among many different ways to solve a problem.
- An algorithm shouldn't include computer code. Instead, the algorithm should be written in such a way that it can be used in different programming languages.
- Now we can implement this algorithm with any computer programming language.
- And now, to understand and also make others understand our algorithm and logic, this should be rewritten in a flowchart format where it explains the logic and the flow of the problem.
The algorithm and flowchart include the following three types of control structures.
- Sequence: In the sequence structure, statements are placed one after the other, and the execution takes place starting from up to down.
- Branching (Selection): In branch control, there is a condition, and according to a condition, a decision of either TRUE or FALSE is achieved. In the case of TRUE, one of the two branches is explored; but in the case of the FALSE condition, the other alternative is taken. Generally, the ‘IF-THEN’ is used to represent branch control.
- Loop (Repetition): The Loop or Repetition allows a statement(s) to be executed repeatedly based on certain loop conditions, e.g., While and for loops.
HOW AN ALGORITHM SHOULD BE?
- Let’s take an example,
Example 1:
- Adding the two numbers entered by the user
- The algorithm should be written in a stepwise procedure as shown below;

Example 2:
- Finding the largest among three numbers

Example 3:
- Finding the Fibonacci series less than 1000

HOW TO REPRESENT THE FLOWCHART?
- The flowchart is represented with a variety of symbols explaining the logic in a shorter way.
- The various symbols used in the flowchart are as follows;
SYMBOLS USED IN THE FLOWCHART:

- These different symbols serve a variety of purposes and so accordingly the flowchart can be built.
Various Operators Used In The Flowchart:
MATHEMATICAL OPERATORS:

Relational Operators:

Logical Operators:

Selection Control Statements:

Loop Control Statements:

Flowchart For Adding The Two Numbers:

- As we saw in the symbols chart, the flowchart should be started and ended with the terminal.
- Now the variables and the data should be defined which is required for the problem solving, so the ‘rectangular’ symbol which denotes any processing with data manipulations should be used here.
- To get any inputs, the ‘parallelogram’ symbol should be used and here the inputs are ‘n1 and n2’.
- Now, we need to carry out the arithmetic operation(addition) and so the ‘rectangular’ symbol is been used and the addition operation is been defined.
- Now the output should be shown and so the ‘parallelogram’ symbol is used as it denotes any kind of inputs and outputs in an algorithm.
- And finally, the flowchart should be terminated using a terminal symbol.
NOTE: All the symbols should get properly connected with the flowlines as which denotes the problem flow.
FLOWCHART TO FIND A LARGEST OF THREE NUMBERS FROM THE USER: (using ‘conditional if loop’)

- As we saw in the symbols chart, the flowchart should be started and ended with the terminal.
- Now the variables and the data (a, b, c) should be defined which is required for the problem solving, so the ‘rectangular’ symbol which denotes any processing with data manipulations should be used here.
- To get any inputs, the ‘parallelogram’ symbol should be used and here the inputs are ‘a, b, c’ given by the user.
- Now, we need to carry out the decision operation(addition) and so the ‘rhombus’ symbol is been used and should check for the condition.
- Now the output should be shown and so the ‘parallelogram’ symbol is used as it denotes any kind of inputs and outputs in an algorithm.
- And finally, the flowchart should be terminated using a terminal symbol.
Flowchart To Find The Fibonacci Series Less Than 1000: (using ‘for loop’)

- As we saw in the symbols chart, the flowchart should be started and ended with the terminal.
- Now the variables and the data(first-term(fterm), second-term(sterm), temp) should be defined which is required for the problem solving, so the ‘rectangular’ symbol which denotes any processing with data manipulations should be used here.
- To get any inputs, the ‘parallelogram’ symbol should be used and here the inputs are ‘fterm and sterm’.
- Now, we need to carry out the operation of creating the Fibonacci series for the numbers less than ‘1000’ and so there should be a loop to repeat the same process for certain number of times.
- Now the second term should be saved in the variable, ‘temp’, and should find the new second term for the next iteration, this process should be repetitive.
- And finally, the flowchart should be terminated using a terminal symbol.
Conclusion:
- Flowcharts are a better way of explaining the logic of the system.
- Flowcharts help in debugging the process.
- With the help of flowcharts, programs can be easily analyzed.
- It provides better documentation.