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
SUSE Linux - Detect new disk (hardware)
Link to PDF files from DVD Menu
Cisco Switch not configured with TACACS asks for username?
Checking for @ symbol in email address field on access form
How to make IN operator to accept CSV which are varchar in SQL Server 2008
vSphere - Hard Disk Size will not go above 256G
Exchange 2010 refusing SMTP port 25 connections
compareTo() - JavaScript example needed
Iphone Can't get Exchange mail on LAN but ok on 3G.
Code was working in Android 2.1 SDK but not on 2.2