#include int main() { // Demonstrate break for loop termination (P267.CPP) int test; int n = 0; cout << "Enter tests or a negative integer or end of file to quit\n"; while(1) // an intentional infinite loop { cin >> test; if(cin.eof() || test < 0) // Terminate loop on either event break; n++; } cout << "\nNumber of tests = " << n << endl; return 0; }