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.



Latest Current Affairs 2024 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad