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
asp.net mssql I have a need to update records where the record column needs modifing in orde to match the Id value
Lightweight network management for mobile workforce
imac osx 10.5 - Does not boot; cannot find harddrive. Getting a folder icon wid a question mark flashin at startup
Diffrence between debug & release versions
C# 4.0 convert from 12h format to 24h format.
Sharepoint Webpart page load event issue
Windows Small Business Server 2008: Critical Event Notification
Intel Sata RAID controller on RHEL 4 problem
Roaming Profiles in Windows 7 Pro and SBS 2008
How do I get this PHP IMAP script to fetch the body of emails? I can't get it to work.