I get a number from the user 1,2, or 3. I have a while loop checking to make sure the input was a 1,2, or 3. The input is then put in a switch statement. The problem is 1 and 2 work, but for some reason 3 doesn't, even though all three numbers codes are pretty much the same. After I put 3 in it acts like it's in a infinite loop, but after using break points it showed it wasn't. It gets out of the while loop and reads the cout after the while loop, but doesn't do it. I'm not sure whats missing.
What exactly do you want this program to do? What do you mean it reads the cout after the while loop but doesn't do it? May I see the question for this code?
theres a cout on line 10 after the while loop. When I run the program and step through it with break points it does get out of the loop and reads the cout << "out of loop/n"; but does output it to the screen and continues on. This only happens when 3 is entered. I'm trying to figure out why…
The input must be exactly 1,2 or 3 so no less-than/greater-than operators
I know, but it's still good to use parenthesis. It emphasizes what order that operations should be executed in. It also eliminates the possibility of a mistake.