Level 49 Level 51
Level 50

Loops


8 words 0 ignored

Ready to learn       Ready to review

Ignore words

Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.

All None

Ignore?
while loop
Repeats a statement or group of statements while a given condition is true. It tests the condition before executing the loop body.
for loop
Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable.
do...while loop
It is more like a while statement, except that it tests the condition at the end of the loop body.
nested loops
You can use one or more loops inside any other while, for, or do..while loop.
break statement
Terminates the loop or switch statement and transfers execution to the statement immediately following the loop or switch.
continue statement
Causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.
goto statement
Transfers control to the labeled statement.
the Infinite Loop
#include <iostream> using namespace std; int main () { for( ; ; ) { printf("This loop will run forever.\n"); } return 0; }