Every number that we enter into any variable is internally stored in the form of binary digits. To perform bit-level operations, C provides the following bitwise operators.
Introduction to bitwise operators
& (binary AND)
This results in a binary 1 if both the operands are 1. If either of the bits is 0, then the result of the & operation is 0.
Assuming that operand A has a value of 1010 and operand B has a value of 0111, then A&B will be as follows:
A | 1010 |
B | 0111 |
A&B | 0010 |
| (binary OR)
This results in a binary 1 if either of the operands is 1...