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
ASA 5505 DMZ won't Access Internet
PHP Statement that shows a percentage of a price
jquery set value of hidden form field
Jumbo frame configuration is saved where?
recover missing emails - information store service stopped
How can I sign certificate request using java.security or Bouncycastle programmatically?
Suggestions for Cicso NM modules for LRE setup
windows 7 home password policy
Making a movie project into a DVD file in Windows 7. How do I burn copies in Vista?
How do I have a field displayed in a report for all data options except one