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
Exchange 2010 RPC error
multiple users having outlook and phones checking one IMAP mailbox, is it a problem?
Removing a tidserv backdoor rootkit on XP
PVST
ASP.NET 2.0 Warning. Event ID 1309 Source ASP.NET.0.50727.0
Database structure - Coldfusion - storing file type
AJAX load HTML into DIV
Adding Roles to Roles In Custom Membership Provider - A Better Way ? C#, SQL, Oracle, ASP.NET
Build and run of Actuate reports
SQL Compare