Bitwise operators works on Bits and performs bit by bit operation.
Let's take a = 60 and b = 13,
in Binary format : a = 0011 1100 and b = 0000 1101
a&b = 0000 1100
a|b = 0011 1101
a^b = 0011 0001
~a = 1100 0011
Let's take a = 60 and b = 13,
in Binary format : a = 0011 1100 and b = 0000 1101
a&b = 0000 1100
a|b = 0011 1101
a^b = 0011 0001
~a = 1100 0011



No comments:
Post a Comment