answersLogoWhite

0


Best Answer

It's the semicolon after the while ()part:

i= 0;

do printf ("%d %s\n", i, argv[i]); while (++i;

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What statement marks the end of a do while loop?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What must happen before the while loop will stop iterating?

The while loop will stop iterating if its condition is no longer true when it reaches the end of an iteration, or if it encounters a break statement.


What is a do while statement in c plus plus?

A do-while statement is a type of loop that iterates while a condition remains true. The condition is evaluated at the end of each iteration, thus the statement always executes at least once. do { statement; } while (expression);


Difference between fixed loop and variable loop?

Fixed loop: this is the loop where the number of iterations are known. Variable loop: Here the number of iterations are not known Example for a variable loop. The pseudocode for variable whille loop begin character cchoice display"enter the choice" accept cchoice while(cchoice='y') begin //execute the statements end end Rkarthikeyan


What is flag controlled while loop?

A while loop evaluates a conditional expression at the start of each iteration. If the conditional expression evaluates false, execution passes to the statement that immediately follows the body of the loop. If the conditional expression evaluates true, the body of the loop executes one iteration. When the end of the loop is reached, or a continue statement is encountered within the body of the loop, control passes back to the while statement where the conditional expression is re-evaluated. If a break statement is encountered within the body of the loop, the loop terminates and control passes to the next statement. If a return statement is encountered within the body of the loop, the loop terminates and control passes to the calling function.while (expression) {// repeats until the expression evaluates false}The braces are optional when the body of the loop is a simple statement. Compound statements must be enclosed in braces.A flag-controlled while loop has a simple conditional expression that evaluates a Boolean value:bool x;// ...while (x==true) { // flag-controlled loop// ...}}The above loop can also be written without the equality operator:while (x) { // flag-controlled loop // ...}Moreover, any integral type (such as int or char) will implicitly convert to a bool such that non-zero values evaluate true and zero evaluates false. As such, any integral type can be used in a flag-controlled loop.


What type of loop uses Boolean expression to control the number of times that it repeats a statement set of statements?

A counted loop. Typically we use a for loop for counted loops: // loop 10 times... for (int i=0; i<10; ++i) { // ... } We can also use while and do-while loops to do the same thing, however a for loop provides all the information up front where it belongs and we can localise the control variable. With while and do-while loops, the control variable must be declared outside the loop, and the increment is usually specified at the end of the loop. This makes while and do-while loops harder to read because the information that controls the loop is separated: // loop 10 times... int i = 0; while (i<10) { // ... ++i; } A do-while loop is similar to a while loop, but the control expression is placed at the end of the loop thus the loop always executes at least once. This also upsets the logic of a counted loop because the control variable is off-by-one. // loop 10 times... int i = 0; do { // ... ++i; } while (i<11);

Related questions

What is used to end a do loop?

A while statement.


What is difference between for loop statement and do while statement in c language?

The for loop has an initializer, an end condition, a loop expression, and a body. The initializer always runs. If the end condition is not satisified, the loop ends or never starts. The loop expression runs at the end of each iteration. Note that the body of a for loop can run no times. The do while statement has a body and an end condition. The body is executed, and then the end condition determines if the loop will iterate. Like the for loop, the loop expression runs at the end of each iteration. Note that the body of a do while loop will run at least one time.


What is while loop?

A do-while loop is a statement or series of statements that are executed at least once. At the end of each iteration, a conditional expression enclosed in a while() statement is evaluated to determine if the loop should start a new iteration or not.


Can you Compare while and do-while?

The 'while' statement evaluates its expression at the beginning of the loop, while a 'do while' statement evaluates its expression at the end of the loop. The 'while' statement might execute no times. The 'do while' statement will execute at least one time. It depends on what you want to do, and on how you want to use the side effects, if any, of the expressions in the expression. (Before or after)


What is a do-while loop?

A while loop evaluates the conditional expression at the start of each iteration, whereas a do..while loop evaluates the conditional expression at the end of each iteration. Thus the do..while loop always executes at least one iteration.


How do you convert a while loop to do-while loop?

A for loop is classified as an iteration statement. A simple example might be... For x = 1 To 10 'loop body Next x The same loop expressed as a while loop (classified as a control flow statement) could be... x = 0 Do While x < 11 'loop body x = x + 1 Loop .


What must happen before the while loop will stop iterating?

The while loop will stop iterating if its condition is no longer true when it reaches the end of an iteration, or if it encounters a break statement.


What is a do while statement in c plus plus?

A do-while statement is a type of loop that iterates while a condition remains true. The condition is evaluated at the end of each iteration, thus the statement always executes at least once. do { statement; } while (expression);


The Do-While loop is what type of loop?

The do loop is similar to the while loop, except that the expression is not evaluated until after the do loop's code is executed. Therefore the code in a do loop is guaranteed to execute at least once. The following shows a do loop in action: do { System.out.println("Inside do while loop"); } while(false); The System.out.println() statement will print once, even though the expression evaluates to false. Remember, the do loop will always run the code in the loop body at least once. Be sure to note the use of the semicolon at the end of the while expression.


What is a basepoint?

A basepoint is a point which marks the beginning and end of a topological loop.


Difference between fixed loop and variable loop?

Fixed loop: this is the loop where the number of iterations are known. Variable loop: Here the number of iterations are not known Example for a variable loop. The pseudocode for variable whille loop begin character cchoice display"enter the choice" accept cchoice while(cchoice='y') begin //execute the statements end end Rkarthikeyan


What is flag controlled while loop?

A while loop evaluates a conditional expression at the start of each iteration. If the conditional expression evaluates false, execution passes to the statement that immediately follows the body of the loop. If the conditional expression evaluates true, the body of the loop executes one iteration. When the end of the loop is reached, or a continue statement is encountered within the body of the loop, control passes back to the while statement where the conditional expression is re-evaluated. If a break statement is encountered within the body of the loop, the loop terminates and control passes to the next statement. If a return statement is encountered within the body of the loop, the loop terminates and control passes to the calling function.while (expression) {// repeats until the expression evaluates false}The braces are optional when the body of the loop is a simple statement. Compound statements must be enclosed in braces.A flag-controlled while loop has a simple conditional expression that evaluates a Boolean value:bool x;// ...while (x==true) { // flag-controlled loop// ...}}The above loop can also be written without the equality operator:while (x) { // flag-controlled loop // ...}Moreover, any integral type (such as int or char) will implicitly convert to a bool such that non-zero values evaluate true and zero evaluates false. As such, any integral type can be used in a flag-controlled loop.