Microsoft
Software
Hardware
Network
Question : C# the differences between Do While Loop and For
I have the following code, which basically do the same thing. However, they have different output layout. Can anybody help me to understand why the output layout is different? one is horizontal, one is vertical .
int counter = 1; // initialize counter
do
{
Console.Write("{0} ", counter);
++counter;
} while (counter <= 10); // end do...while
Console.WriteLine(); // outputs a newline
for (int i = 0; i < 11; i++)
{
Console.WriteLine(i);
}
Attachments:
doWhile-For.JPG
(21 KB)
(File Type Details)
doWhile&for
Answer : C# the differences between Do While Loop and For
one is write and the other is write line
Random Solutions
Using ADFind to input all account in specific OU where the Accounts expire is set after the current day
Generate email and append fields to body
SQLCommandBuilder - GetUpdateCommand, GetInsertCommand and GetDeleteCommand Questions
Jquery Dialog Ajax problem
asp.net-easy question
PHP: Get 6 most recent Youtube video links
proxy issue and httpwebrequest
Starting letters with XXX
Install .PFX file to personal store - Certificate Authority
Accessing url variables to expand the correct menu item in JQuery Expand Function