210CT Machine ID

PHOTO EMBED

Fri Nov 13 2020 03:52:42 GMT+0000 (Coordinated Universal Time)

Saved by @uchenliew #c++

cout << "Machine ID: ";
	//WHILE LOOP: check whether Machine ID is in numeric
	while(!(cin >> machineID)){
		//display error message
		cout << "ERROR! Invalid Machine ID! Please try again..." << endl;
		cout << "Machine ID: ";
		
		cin.clear(); //clear previous user input
		cin.ignore(INT_MAX, '\n'); //discard previous user input
	}
content_copyCOPY