Hour 15. Looping for Efficiency

   

Hour 15. Looping for Efficiency

graphics/newterm.gif

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


Sams Teach Yourself C# in 24 Hours
Sams Teach Yourself Visual Basic 2010 in 24 Hours Complete Starter Kit (Sams Teach Yourself -- Hours)
ISBN: 0672331136
EAN: 2147483647
Year: 2002
Pages: 253
Authors: James Foxall

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net