Computer Science, asked by masumkumari64, 3 months ago

Explain with an example the difference
between DO WHILE LOOP and DO
LOOP WHILE​

Answers

Answered by vishalbanjare14
0

Explanation:

Here, the main difference between a while loop and do while loop is that while loop check condition before iteration of the loop. On the other hand, the do-while loop verifies the condition after the execution of the statements inside the loop. ... Conversely, the do while loop is called the exit controlled loop.

BASIS FOR COMPARISON WHILE DO-WHILE

General Form while ( condition) {

statements; //body of loop

} do{

.

statements; // body of loop.

.

} while( Condition );

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

Iterations The iterations do not occur if, the condition at the first iteration, appears false. The iteration occurs at least once even if the condition is false at the first iteration.

Alternate name Entry-controlled loop Exit-controlled loop

Semi-colon Not used Used at the end of the

Answered by deviheera782
0

Answer:

HOPE IT HELPS U

Explanation:

do-while loop is similar to while loop, however there is a difference between them: In while loop, condition is evaluated first and then the statements inside loop body gets executed, on the other hand in do-while loop, statements inside do-while gets executed first and then the condition is evaluated

Similar questions