#include <iostream> #include <limits> using namespace std; int main() { int num1; cout<<"\nEnter first number:\n"; cin>>num1; while(!cin.good()) { //this means while input is not valid, do this. // if input is valid, this code will not execute cin.clear(); //clear the error state //ignore all characters left in the buffer cin.ignore(numeric_li..