Chemistry, asked by harivansh71, 11 months ago

explain the difference in while and do while loops

Answers

Answered by ryan567
11
✌✌hey mate ur ans✌✌

➡WHILE LOOP

✨while loops is entry control loop
✨while loop first check the condition then execute the statement
✨The loop will not execute at all if conditions is not satisfied
▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪
➡➡DO WHILE LOOP

✨it is known as exit control loop
✨it check the condition after execution
✨the loop will execute at least once

☺☺hope it helps Mark as brainliest and follow me☺☺
Answered by BrainlyPromoter
4
\large\underline\bold{Question:}

Explain the differences between while and do while loops.

\large\underline\bold{Answer:}

Looping statements will not be executed in while loop if condition is not satisfied but in do while loop the looping statements are executed at least once even if the conditions prove to be false.

The condition of loop is checked in the beginning of the while loop but the condition is checked at the end of do while loop.

The while loop requires only one statement(i.e. While) to complete the loop whereas in do while loop the two statements(i.e. do and while) are needed to complete the loop.

The while loop is entry-controlled whereas the do while loop is exit- controlled.

\large\underline\bold{Thanking You!}

BrainlyPromoter: welcome
Similar questions