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.



CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad