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.
Copyright © 2026 eLLeNow.com All Rights Reserved.