Nested loop

Nested loops consist of two (or more) loops. A loop which is inside is called an inner loop and the loop which is outside is called an outer loop.

One the example of using a nested loop is to count number of cells in a rectangle. One the loops will count cells that are horizontal and another one will be counting cells that are vertical.

I know that this process is inefficient, there is more efficient way of doing it, but I hope that this example gives a good example of using a nested loop.

Comments

Popular posts from this blog

Absolute and relative path in HTML pages

Errors

goto PHP operator