Hi. I'm extremely new to this. I'm trying to do the user==gullible exercise. This is the instruction.
While( user == gullible )
variables, data types, and numerical operators
logic (if statements, switch statements)
loops (for, while, do-while)
Write a program that ccntinues to asks the user to enter any number other than 5 until the user enters the number 5.
Then tell the user "Hey! you weren't supposed to enter 5!" and exit the program.
using namespace std;
cout << "Enter a number other than 5. " << endl;
cin >> num;
while (num != 5)
cout << "Please enter another number. " << endl;
cout << "I told you not to enter 5. " << endl;
What I don't understand is when I debug this and I enter a number other than 5, it won't stop saying "Please enter another number." But, when I enter 5, it does it correctly and exits the program. What's wrong with my while loop?