Difference Between While-loop & Do-while-loop in C
While-Loop
Do-While Loop
Entry-Controlled Loop
Exit-Controlled Loop
Loop Condition has to be initially
TRUE for body to be executed
Loop body will be executed at-least once
Initialization,Condition,Update
Statements are to be written Separately
Initialization,Condition,Update
Statements are to be written Seperately
Syntax :
exp1;
while(exp2)
{
statement...
statement...
exp3
}
Syntax :
do
{
statement...
statement...
} while(condition);