What is the difference between & (bit-wise AND), and I (bit-wise OR) operators?
Question :
What is the difference between & (bit-wise AND), and I (bit-wise OR) operators?
Bit-wise AND (&) returns 1 if both the bits are 1, otherwise 0. For example, the numbers 5 & 3 gives 1.
Bit-wise OR (|) returns 1 if any both of the bits is 1. If both the bits are 0, then it returns 0. For example, the numbers 5 | 3 gives 7.