As you develop your C# programs, you'll encounter situations in which you'll need to execute the same code statement or statements repeatedly. Often, you'll need to execute these statements a specific number of times, but you may need to execute them as long as a certain condition persists (an expression is true) or until a condition occurs (an expression becomes true). C# includes constructs that enable you to easily define and execute these repetitive code routines: loops . This hour shows you how to use the two major looping constructs to make your code smaller, faster, and more efficient. |
The highlights of this hour include the following:
Looping a specific number of times using for statements
Looping an indeterminate number of times using do while and while statements
Top |