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
VirtualInfrastructure.Util
s.HttpWebR
equestProx
y' threw an exception.
Office 2007 Excel cells appear blank
Cisco ASA 5520
Issuie Identifying XML feed issue
Terminal Server client side CD/DVD writing
How to Protect a Client connection to remote SQL Server Database
XSLT Wildcards and custom processing.
fiddling nose habit
Advise on anti-spam measures
ZFS Fuse help Ubuntu 10.0.4 LTS