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
String manipulation - SLB FP Equity --> SLBP.PA
Error string in catch block?
Setting msExchMailboxSecurityDescr
iptor with VB.NET
Blackberry Users can receive but not send
Word 2002/xp: Error Message: "Run-time error '4248'; 'This command is not available because no document is open.'"
How can I parse the following string, store it in a variable and then use those variables to populate some txt fields?
Does this HP ML370 G3 server support 64-bit OS?
Shell command doesn't work on all computers
Video Chat Capabilities
Store file in mysql using connector.net and blob field