Most programs include some form of iteration or looping. One of the easiest ways to create a loop in a C program is by using the for statement. This section shows how a for loop can be represented in a flowchart. As shown below, there are several methods of representing a for loop in a flowchart.
Suppose that we have a for loop as below and we wish to draw an equivalent flowchart.
Method 1
Figure 8.14 shows one of the methods for representing the above for loop as with a flowchart. Here, the flowchart is drawn using the basic primitive components.
Method 2
Figure 8.15 shows the second method for representing the for loop with a flowchart. Here, a hexagon shaped flowchart symbol is used to represent the for loop and the complete for loop statement is written inside this symbol.
Method 3
Figure 8.16 shows the third method for representing the for loop with a flowchart. Here again, a hexagon shaped flowchart symbol is used to represent the for loop and the symbol is divided into three to represent the initial condition, the increment, and the terminating condition.
3.17.110.58