Flowchart in Computer Programming

A flowchart can be used to depict the algorithms in computer programming. You can describe individual commands, conditions, loops, inputs, and outputs with visual symbols.

Input and Output

Generally, you can use Data symbol for input or output actions in your algorithm. Alternatively, you can use the User Input symbol if the input is entered solely by a user. If you want to show the output to the user, you can use Display symbol in your flowchart. The output can be displayed on a screen or printed.

Input and Output in Flowchart
Input and Output in Flowchart

Declaring Variables

You can use Internal Storage symbol or simple Process symbol for variable declarations.

Declaring a variable in Flowchart
Declaring a variable in Flowchart

Assignment Statement

There is not any specific shape for the assignment statement. If you want to show a variable assignment in your flowchart, you can just use the Process element.

Call Method

If you want to call another subroutine, procedure, or function, you should use the Predefined Process element.

Call other method in Flowchart
Call other method in Flowchart

If Statement

If and else-if conditions are represented using Flow branches that lead from Decision symbol (diamond). The condition is stated within the diamond shape. The branches are labeled as Yes or True for the met condition and No or False for the else branch.

You can check out our template for multiple else-if branches here.

If condition in Flowchart
If condition in Flowchart

Switch Case

Switch statement for multiple cases is depicted similarly as an if-condition in flowcharts. The switch variable is given in a Decision diamond. The individual cases are represented by Flow branches. The values of the cases are stated as labels for flow connectors.

The template for switch cases is available here.
Switch cases in Flowchart
Switch cases in Flowchart

While Loop

The condition for the while loop is displayed inside the Decision symbol. The flow from the last Process element (that represents the last statement within the while loop) points to the starting decision element. The decision element has two flow branches - one leads to while-loop statements (it can be labeled as Yes or True), and the other flow leads out of the loop to the following statements.

Wait in Flowchart
Wait in Flowchart

The example here shows how to draw flowchart for while and for do-while loops.

Return Statement

The Return statement is depicted using the Flow connector that leads to the End symbol (rounded rectangle, stadium shape).

Break, Continue

If you want to translate the Break or Continue statement from a program code into a flowchart, you can do it using the Flow relationship that connects the respective places in the program flow.

Wait

If you need to indicate waiting in your algorithm flowchart you should use the Delay symbol. It is a rectangular shape rounded on the right side. The waiting time or the condition when the waiting ends can be expressed inside the Delay shape.

While-Loop in Flowchart
While-Loop in Flowchart

New Comment

Comment