You are here

Counting Loop Conversion -a while into a for

19 January, 2016 - 11:41

Below is a color coded the conversion of a while loop that displays a message exactly three times (which is a counting loop) into a for loop using C++ programming language syntax. The four loop attributes are color highlighted as follows:

Figure 15.1 Counting loop