 Here's a quick review of the truth tables for bitwise operators The table for bitwise and says the result is one only when both the bits are one The table for bitwise or says the result is one when either of the bits or Both of the bits are one This doesn't match up with the way most people think of or if you ask them do you see a square or a circle? Most non-programmers will say no. I see both of them It turns out that there's an operator that works the way people think or should work. It's called exclusive or This operator gives a one when either of the operands are one, but not both When should you use or and when should you use exclusive or? If you want to set bits use or if you want to flip bits From one to zero and from zero to one use exclusive or and when you're using logical conditions Rather than manipulating bits you want to use the double vertical bar the logical or operator