What is the difference between while and do-while statements.
Answers
Answered by
1
In a do..while loop, the condition is not evaluated until the end of each loop. ... Do while loop will be executed atleast once.......but while loop will check the condition first and then it may or may not get executed depending on the condition.
Answered by
0
A while statement is used to execute a command only if a certain statement is true and the condition can be fulfilled.
The do while statement is used to, on the other hand, execute statements even if the condition given is not true.
The while statement doesn't execute if the condition is false.
The do while statement executes at least once even if the condition is not true.
Similar questions
Computer Science,
7 months ago
Math,
7 months ago
Science,
7 months ago
Computer Science,
1 year ago
Science,
1 year ago
Computer Science,
1 year ago