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 to strip everything from document.domain
How do I remove old servers from backup Exec?
Out-bound Call Center Setup!!!!
how can i pay electricity bill online using hdfc netbanking ??
Windows Server 2008 R2 iSCSI Initiator and HP D2D CHAP issue
Delphi, forms in Dll and Threads
USB Video Card - 32 bit on 64 bit machine?
SBS 2k3 unable to relay mails
Perl, Using Text::CSV_XS / Count number of references
Joomla Re-install