Differentiate between while and do-while Loop
Java Language
50 points (:
Answers
Answered by
6
Answer:
Here's the difference between while and do - while loop in Java :-
==> In Java While loop, the condition is tested at the beginning of the loop, and if the condition is True, then only statements in that loop will be executed. So, the While loop executes the code block only if the condition is True.
==> In Java Do While loop, the condition is tested at the end of the loop. So, the Do While executes the statements in the code block at least once even if the condition Fails.
hope it helps ✔✔
Answered by
2
Explanation:
If the condition in a while loop is false, not a single statement inside the loop is executed. In contrast, if the condition in 'do-while' loop is false, then also the body of the loop is executed at least once then the condition is tested.
Hope it helps you Mate ✌ ✌
mark as brainliest plz.
Similar questions
Math,
5 months ago
Hindi,
5 months ago
Computer Science,
5 months ago
Geography,
10 months ago
Social Sciences,
1 year ago
Math,
1 year ago
English,
1 year ago