34,333
edits
Changes
no edit summary
The C# ''for'' loop described in [[C Sharp Looping - The for Statement|C# Looping - The for Statement]] previously works well when you know in advance how many times a particular task needs to be repeated in a program. There will, however, be instances where code needs to be repeated until a certain condition is met, with no way of knowing in advance how many repetitions are going to be needed to meet that criteria. To address this need, C# provides the ''while'' loop (yet another construct inherited by C# from the C Programming Language) .
== The C# while Loop ==