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 can i do insert more data with insert query with more select statment linqToSQL?
How to compress a string into a short representation in ASP.NET using C# or VB.NET?
Asp.Net profile information in SQL view
Looking for Video Recording Software for Samsung Cameras
SqlDataAdapter InsertCommand not updating primary key value in dataset
Difference between SSID and BSSID
What is differnce between machine.config and web.config?
XenServer 5.5 The Storage repository is not available.
VB.Net 2008 Problem passing data between forms
Font Question