Do While Loop

The condition is evaluated after the body of the loop gets executed

The structure of the do…while loop is as follows:
do
{
//statements
} while (condition);
A do…while loop is similar to a while loop, except that a do…while loop is guaranteed to execute at least one time.

The for Loop:

for ( initial; condition; increment )
{ statements; }
initiali, condition, and increment are all C expressions, and statement is a single or compound C statement.
Some valid for statements:
for (count = 100; count > 0; count–)
for (count = 0; count < 1000; count += 5)
count = 1;
for ( ; count < 1000; count++)
for (i = 0, j = 999; i < 1000; i++, j–)


null

Mr. Sandeep Soni

Founder, Trainer & CEO, Deccansoft Software Services.

Sandeep has 21 yrs of experience working in various Microsoft Technologies/Platforms incl. VB6.0, ASP, VC++, VB.NET, C#. He is involved in managing and architecting projects at Deccansoft. He will be your liaison to Deccansoft, for any kind of communication and project updates. He knows what works and what doesn’t, and what practices are most suitable for design and programming with the ultimate goal of producing a quality system.