Changes

Jump to: navigation, search

C Sharp Looping with do and while Statements

7 bytes removed, 20:03, 27 October 2016
m
Text replacement - "<table border="0" cellspacing="0">" to "<table border="0" cellspacing="0" width="100%">"
<googlehtmlet>BUY_CSHARP_ESSENTIALScsharp</googlehtmlet>
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 ==
}
</pre>
<googlehtmlet>ADSDAQBOX_FLOWadsdaqbox_flow</googlehtmlet>
In the above example, the ''while'' expression will evaluate whether the ''myCount'' variable is less than 100. If it is already greater than 100 the code in the braces is skipped and the loop exits without performing any tasks.
<googlehtmlet>BUY_CSHARP_ESSENTIALS_BOTTOMcsharp</googlehtmlet>
 
<htmlet>ezoicbottom</htmlet>
<hr>
<table border="0" cellspacing="0" width="100%">

Navigation menu