Which of the following loops will execute the body of loop even when condition
the loop is emirially false
Answers
Answered by
1
Answer
As we saw in a while loop , the body is executed if and only if the condition is true .In some cases , we have to execute the body of the loop atleast once even if the condition is false.This type of operation can be achieved by using a do-while loop.
Answered by
112
while loop is executed once before the condition is checked. Its syntax is: do { // body of loop; } while (condition); ... If the condition evaluates to true , the body of the loop inside the do statement is executed again.
Similar questions