// Mr. Minich

// CMPSC 101

// Ch. 7 Demo Program #8
// January 30, 2000 // Purpose - to illustrate the use of determinant, indeterminant, and nested loops.
#include <iostream>
using namespace std;
int main() { int loopVariable = 0; // loop variable while (loopVariable < 10) { cout << loopVariable << endl;
loopVariable++;
if (loopVariable == 5) { break;
}
}
// What values will be printed by the loop above?
for (int i = 1; i < 10; i++) { loopVariable = 1; do { cout << (loopVariable + i) << endl; loopVariable += 2; if (loopVariable >= 5) {
break;
}
} while (loopVariable < 1000); }
// This is an example of nested loops with a do loop inside // of a for loop. // Predict what values will be printed out. Realize though // that the break command only breaks out of the inner do loop // each time that it applies.
return 0; }// end of main