1.
Difference Between Entry Controlled Loop
and Exit Controlled Loop
2.
Difference Between Break and Continue
3.
Difference Between While and Do…While
1. Difference Between Entry Controlled
Loop and Exit Controlled Loop
Entry Controlled Loop
|
Exit Controlled Loop
|
In entry controlled loop condition is checked at the
starting of the loop.
|
In exit controlled loop condition is checked at
|
In entry controlled loop if condition
|
In exit controlled loop if condition
|
2. Difference Between Break and Continue
Break
|
Continue
|
Break statement
|
Continue statement
|
3. Difference Between While and Do…while
While
|
Do…while
|
In while loop condition is checked at
|
In do…while condition is checked at
|
It is
|
It is
|
If condition
|
If condition
|
Syntax:
While(condition)
{
Body of loop
}
|
Syntax:
do
{
Body of loop
}While(condition)
|
Example:
Int i=8;
While(i>10)
{
Printf(%d\n”,i);
i++;
}
Output :
No Output
|
Example :
int i=8;
do
{
Printf(“%d\n”,i);
i++;
}while(i>10);
Output :
8
|
Post a Comment
Please do not enter any spam link in the comment box.