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

Summary

This chapter explored the fundamental aspects of iteration and how to implement this essential programming tool by using C#'s three types of iteration statements—while, do-while, and for loops.

Important points mentioned in this chapter are reviewed in this section.

An iteration statement repeats a statement or block of statements as long as its loop condition is true.

Iteration statements are often used to generate or analyze (traverse) a sequence of data elements.

The while loop statement consists of the while keyword, a loop condition, and a loop body (consisting of one or more statements) that is repeatedly executed until the loop condition is false. The while loop is an entry condition loop, so its loop body may never be executed ...

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