O'Reilly logo

Start Here!™ Fundamentals of Microsoft® .NET Programming by Rod Stephens

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

Looping Statements

To allow you to use a series of statements repeatedly, programming languages provide looping statements. Usually a variable or some other factor changes as the loop progresses so that the statements inside the loop don’t do exactly the same thing every time the loop repeats. For example, a loop to print 100,000 copies of a single customer’s invoice would be a lot less useful than a loop that prints different invoices for each of 100,000 customers.

Once in a while, you might want a program to enter a loop that never ends (for example, a program that runs continuously while the computer is running), but usually a loop should stop at some point. To ensure that a program doesn’t get stuck in an infinite loop, you should examine the ...

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