I need a help from you.
I'm writing a c++ console program that only accept only positive number.
If the user enter an invalid number like negative and string, I want to display like
cout << "Enter a number";
I want to loop this message until user enter valid input.
I'm using an integer variable for cin.
So if the user enter string input, the program occurs error.
I don't know how to loop for that condition bcoz I assumed that user may also enter string as invalid input.
So if the user enter negative number or string, I want to display again and again this message.
Thanks in advance,
Edited 6 Years Ago by rain.divine88: n/a