answersLogoWhite

0

A Do-While loop looks like this:

do {

loop body

} while (condition);

and a While loop looks like this:

while (condition) {

loop body

}

The main difference is that the loop body is always run once in the Do-While loop, then the condition is checked to see if the loop should keep running. In a While loop, the condition is checked first, and it will not run the loop body at all if the condition is false.

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

What is the difference between while dowhile?

While: If we can use while statement it will check the condition then proceed further loop statement.DoWhile: If we use dowhile, first execute loop statement then check the condition.


List out the differences between while and dowhile statement?

The do ..while loop is executed at least once, whereas the while loop may not be executed even once.


What is a dowhile statement in C programming?

"do statement while (...);" is a loop which does at least one iteration even if the condition after while is false. When, for instance, "while(...) statement" does not iterate at all if the condition after while is false.


Is a DOWHILE loop more flexible than a dountil loop?

No, they are equivalient. DO something WHILE condition; does the same thing as DO something UNTIL NOT condition;


Compare and contrast vision statements with mission statements in terms of composition and importance?

uuyfhujgjkg


What is Difference between if statement and select case statement in vbscript?

If statements and Select-Case statements are two similar features that allow for code branching. The difference is that each If statement may compare against different variables and different ranges, while Select-Case statements may only compare against one variable at a time, and must compare against discrete values. Select-Case is therefore a specialized form of If statements, and are more efficient in terms of amount of code used and execution speed when used instead of theequivalentIf-Else statements.


What is difference between while and dowhile?

the test condition will be checked first after wards the body of the loop will be excuted in while statement and the the do while statement represented the body of the loop will be executed first and then the test condition will checked next


Compare and contrast vision statements with mission statements in terms of composition and importance.?

uuyfhujgjkg


What is unique about a DOWHILE loop?

A DO-WHILE loop will always execute at least one iteration of the loop body. This is because the condition that controls the loop comes at the end of the loop, rather than at the beginning as per a WHILE or FOR loop.


Compare and contrast vision statements with mission statements?

A vision statement describes the desired future state or long-term goal of the organization, while a mission statement outlines the purpose, core values, and primary objectives that guide the organization's actions. Vision statements are aspirational and focus on where the organization wants to be in the future, while mission statements are more grounded in the present and often address how the organization serves its stakeholders. Both statements are important for articulating the overall direction and purpose of the organization.


Which is faster to find factorial whether recursive or dowhile?

recursion is always slower than iteration


What includes the horizontal analysis of comparative statement?

In Horizontal analysis of statements companies tries to compare its financial statements with competitors to see that how well or bad they have performed.