I cannot figure out why the program always displays the error message. I am trying to write it so it displays the error message if the int variable "code" is not 1,2,3 or 4.
Can someone help me please.
PS this is not for a test or anything. It is just a flowchart that was given to me for practice to turn into code. Thanks guys.
code == 1 || code == 2 is the condition you're looking for. code == 1 || 2 always evaluates to true, because (x || true) == true (remember that true is defined as anything other than zero).