Chapter 14. Looping for Efficiency

<feature><title>What You’ll Learn in This Hour</title> <objective>

Looping a specific number of times using for statements

</objective>
<objective>

Looping based on a condition using do...while and while statements

</objective>
</feature>

You will often encounter situations in which you need to execute the same code statement or group of statements repeatedly. When that happens, you will need to execute some of these statements a specific number of times, whereas others might need to be executed as long as a certain condition persists (an expression is true) or until a condition occurs (an expression becomes true). Visual C# includes constructs that enable you to easily define and execute these repetitive code routines: ...

Get Sams Teach Yourself Visual C# 2008 in 24 Hours: Complete Starter Kit now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.