Lecture#08, Repetition Structures
,Today’s Lecture Contents
Repetition Structures
While loop
Do-while loop
Common Programming Errors
break / continue keywords
Nested loops
, while Loop
Simplest kind of loop (repetition structure) is while-loop. Its
syntax is:
1. while is a C++ keyword
2. Condition is a Boolean
expression
3. Set of semi-colon
separated statements
4. Start of loop body
5. End of loop body
Note: while-loop statements keep executing until loop-condition evaluates to FALSE