I am new to c++ and I am trying to implement a simple "password" system that takes a password in the form of a number. Make it so that either of the two numbers is valid, but use only one if statement to do the check.
But no matter what I try I cant get the if statement to check my code. Can any one help? Or give me a hint on what is wrong with my code.
"5 or 6" This literally checks for "5 or 6", so I would only have the correct password if I literally type in '5 or 6'. You are wanting to be using the logical or operator, which is '||'. && password == "5" || password == "6"