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
Comparing columns in a table
Google adwords campaign
How to undelete public folder content on MS Exchange Server 2000
user rights and administrative rights problems on domain
Mac OS X 10.6.3 Can't logon to Active directory
error SQL3126N when loading data from local file to remote DB2 instance
Inserting image in Word 2007 table
CKEditor: How to update textarea using javascript?
Installing MAPI CDO on Exchange 2007
Calendar Control in Excel 2003 VBA