Hello guys; I am wondering if you can help me.
How can I write my simple program so if the user enters an invalid number,
The program won’t exit? I know I am supposed to use a if (cin) or if (!cin),
But I don’t know where in the program or how I should use it. Right now my
Program looks kind of like this:
If (number > 1 && number < 1001)
Go through some function loops
Else
Cout << “invalid number”;
I need to write it so when the user enters an invalid number, the program
Would Keep asking for the right number until it's given.
Thanks guys.