answersLogoWhite

0

A condition-controlled loop is one that has an indefinite number of iterations; its opposite is the count-controlled loop. Condition-controlled loops execute until some event occurs, which is usually user-initiated. For example, modern programs run an condition-controlled loop similar to the following:

while(GetMessage(message,hwnd,0,0)) { ... }

This loop continues to execute until there are no messages left (the WM_QUIT message is returned, which has a value of zero).

It is impossible to identify before execution the number of times such a loop will run, except during controlled tests, although you can easily identify what conditions will cause it to terminate.

What else can I help you with?

Related Questions

When would you use a count controlled loop vs. a flag controlled loop?

Counter Loop:Counter loop is a loop which executes statement up to a fixed number of time.In GW FOR ... NEXT loop is used as counter loop.Controlled Loop:Controlled loop is used to extend the statements till a specific condition is satisfied. In GW WHILE ... WEND is used as controlled loop.


What are the differences between a condition-controlled loop and a count-controlled loop?

A Condition-Controlled loop keeps going until a certain condition is met, like say the user clicks a button, or the world ends or something. A Counter controlled loop keeps going until it has run a certain number of times. For example if you create a variable x=0. And then every time your look runs you increase x by 1 (x=x+1), you can tell your loop to keep running until x=5. That way the loop would run 5 times until the *COUNTER* reaches 5. This would be a counter controlled loop


What is a sentinel controlled repetition?

A sentinel-controlled repetition is a loop structure where the continuation of the loop is determined by a special condition called a sentinel value. When the sentinel value is encountered, it signals the end of the loop. This allows the loop to run until a specific condition is met, rather than for a predetermined number of iterations.


What is the difference between entry and exit controlled loops - in Java?

while loop and for loop are entry controlled loops as they check looping condition at the entry point. do while loop is exit controlled loop as it checks looping condition at exit point. shreeradha@yahoo.com


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

input:while (condition) statementoutput:for (;condition;) statementor, if you mean do-while:do { if (condition) statement } while (condition);


What is for looping in c language?

The for loop is another entry-controlled loop that provides a more concise loop control structure.The general form of the for loop isfor( initialization ; test condition ; increment ){body}Generally this loop is used when the either the no. of loops or the looping condition or the end condition is known.Ex.to count n no. of integers.Hope this will help.


What do you mean by loop check?

A loop check is a condition that is checked everytime a loop is executed. It is usually the condition that needs to match for the loop to terminate. Until this condition is matched the loop will continue to execute. Ex: for(int i=0; i<10; i++) { … } In the above for loop "i<10" is the loop check condition and this loop will execute until the value of i is less than 10. It starts at 0 and gets incremented by 1 everytime the loop completes an iteration of execution


What do you mean by check?

A loop check is a condition that is checked everytime a loop is executed. It is usually the condition that needs to match for the loop to terminate. Until this condition is matched the loop will continue to execute. Ex: for(int i=0; i<10; i++) { … } In the above for loop "i<10" is the loop check condition and this loop will execute until the value of i is less than 10. It starts at 0 and gets incremented by 1 everytime the loop completes an iteration of execution


What does a count-controlled loop mean in programming?

A condition-controlled loop is one that has an indefinite number of iterations; its opposite is the count-controlled loop. Condition-controlled loops execute until some event occurs, which is usually user-initiated. For example, modern programs run an condition-controlled loop similar to the following: while(GetMessage(message,hwnd,0,0)) { ... } This loop continues to execute until there are no messages left (the WM_QUIT message is returned, which has a value of zero). It is impossible to identify before execution the number of times such a loop will run, except during controlled tests, although you can easily identify what conditions will cause it to terminate.


Is a while loop a pre-condition or post condition?

The while loop is a pre-condition loop.  It tests the condition at the beginning of each loop, executes the loop if it is true, and goes back to the test after executing each iteration.


Compare Do-While with While Statements?

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.


What is the significance of test condition in a loop?

The test condition in a loop is what's used to determine when the loop should end.