O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Nested Iteration Statements

The loop body of any iteration statement can consist of one or more statements. Because each iteration statement is a statement in itself, it can be nested inside the loop body of another iteration statement. An infinite number of iteration statements can be nested inside each other.

A nested loop consists of one loop (called an inner loop) residing inside another loop (called an outer loop).

Every time the outer loop executes its loop body once, the inner loop executes all of its loops. To illustrate this process, let's first have a look at an example containing only a single for loop and no nested loops yet. In a moment, we will expand this example with a nested for loop. Our first modest aim here is to construct ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required