I have this program here, it isn't complete, just starting it off. It's a switch sequence within a do while loop. If the user input is Q or q the program should quit. However when I put while((option != 'Q') || (option != 'q')); It doesn't end the program either way but if I just put while(option != 'Q'); it ends when i type in Q but I also need it to end when I type in q. Here is my code:
A B | A || B
-----------+-------
T T | T
T F | T
F T | T
F F | F
When either condition is true, the overall condition is true. If choice is 'Q' then choice != 'q' is true. Likewise, if choice is 'q', then choice != 'Q' is true. And if neither is the case, the overall expression also evaluates to true, so what you wrote is equivalent to: