I need help trying to figure out how to output an error message if any of my input is inappropriate.
If any of the entries is >100, then it should display "Error: Data out of range". But it has to be done in the same way the "Error: Inproper numeric format" message appears, in case letters are inputed instead of numbers.
My program looks like this:
int main (void)
{
cout << "Enter three test scores in the range [0..100], " << endl;
cout << "separated by spaces: ";
int A, B, C;
cin >> A >> B >> C;
cin.ignore(99,'\n');
if (!cin)
{
cin.clear();
cin.ignore (99,'\n');
cout << endl;
cout << "Error: Improper numeric format. Press Enter to terminate program...";
cin.ignore(99,'\n');
return 1;