cplusplus:repetition_examples
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
cplusplus:repetition_examples [2019/02/14 21:25] – [increment operator] mithat | cplusplus:repetition_examples [2019/02/14 21:27] – [Counter-controlled repetition] mithat | ||
---|---|---|---|
Line 50: | Line 50: | ||
{ | { | ||
const int UPPER_LIMIT = 5; | const int UPPER_LIMIT = 5; | ||
- | int num = 1; | + | int num = 1; // initialize the counter |
- | while (num <= UPPER_LIMIT) | + | while (num <= UPPER_LIMIT) |
{ | { | ||
cout << num << endl; | cout << num << endl; | ||
- | num++; | + | num++; |
} | } | ||
cplusplus/repetition_examples.txt · Last modified: 2019/02/14 21:28 by mithat