#include #include using namespace std ; int main() { int i1= 0 ; cout << "Enter an integer1." ; cin >> i1 ; //cout << "i1:" << i1 << endl ; //Once cin goes into an error state. //All bets are off cin.clear() ; cin.ignore(10000, '\n'); cout << "Enter an integer2." ; cin >> i1 ; cout << "i1:" << i1 << endl ; while( !std::cin ) { cin.clear() ; cin.ignore(10000, '\n'); cout << "Enter an integer3." ; cin >> i1 ; } return 0; }