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
Need a solution for Sum within a Sum
RAID1 in MAX OSx
The object invoked has disconnected from its clients.
FTP Script via Unix
How to insert a single blob?
Outlook2007/ Exchange: Need password to connect
Can't send emails (Vista Business, United Kingdom, Demon Mailbox/Demon Broadband)
Import text file - definition (field name, delimited, lng) based on a table
PHP: import several RSS feeds into MySQL
MySQL Rows to Columns by Group