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
How to block mulitple ports within a range in mmc?
Failing over between Active/Active WAN connections on a Cisco Router
Unable to install Webmin
Evnet id 10016 - DCOM & DFS
Frameless and Borderless Popup Window in Flash Actionscript 2
Using wininet.dll with vba code within Excel 2003 macro on windows 2008 R2 server. FTP hangs
Flash advanced Datagird sorting
Table Design
jsp forwarded address
Switch 3Com 4800G doesn't save configuration ?