Computer Science, asked by jkbeatboxing, 10 months ago

. Differentiate between while, do...while, and for loops in terms of their syntax.​

Answers

Answered by priyarabadiya171
4

Answer:difference between while and do while

Explanation:

while loop...

syntax:

while ( condition) {

statements; //body of loop

}

In 'while' loop the controlling condition appears at the start of the loop.The iterations do not occur if, the condition at the first iteration, appears false.

it is a Entry-controlled loop

Semi-colo Not used..

do while loop...

syntax:

do{

.

statements; // body of loop.

.

} while( Condition );

In 'do-while' loop the controlling condition appears at the end of the loop.

The iteration occurs at least once even if the condition is false at the first iteration.

it is Exit-controlled loop.

Semi-colon used at end of the loop.

Similar questions