Flowchart of Nested For Loop

A good deal of traditional programming languages have 4 sections called, initialization, condition, increment/decrement and body. In this post, I’m sharing with you on how we can depict this flow in a flowchart. Hope it helps, let me know in comments if you are looking for something else.

Nested for loop Flowchart
Nested for loop Flowchart

A typical nested for loop to traverse a matrix in traditional programming languages such as C, C++ or Java looks as below:

for(i = 0; i < 3; i++) {
    for(j = 0; j < 3; j++) {
        System.out.println(matrix[i][j]);
    }
}

Let us depict this code in a flowchart.

Nested for loop Flowchart for Metrix traversing
Nested for loop Flowchart for Metrix traversing