Note:

Bit wise NOT : Value of 40 in binary is 00000000000000000000000000000000 00000000000000000010100000000000. So, all 0’s are converted into 1’s in bit wise NOT operation.

Bit wise left shift and right shift : In left shift operation “x << 1 “, 1 means that the bits will be left shifted by one place. If we use it as “x << 2 “, then, it means that the bits will be left shifted by 2 places.

Example program for bit wise operators in C:

In this example program, bit wise operations are performed as shown above and output is displayed in decimal format.