// Computing square with input control #include using namespace std; int main() { double valnum; cout << "Input number: "; cin >> valnum; if (cin.good()) cout << "Number " << valnum << " squared is " << valnum*valnum << endl; else cout << "Input error -- number required." << endl; }