Electrical and Computer Engineering
19 of 23
UAH
CPE 112
cin EOF Example
•cout << “Enter an integer (or Ctrl-D to quit): ”;
•cin >> someInt;
•while (cin)
•{
•    cout << someInt << “ doubled is ”
•          << 2 * someInt << endl;
•     cout << “Next number (or Ctrl-D to quit): ”;
•     cin >> someInt;
•}