DEV Community

Safal Bhandari
Safal Bhandari

Posted on

Bitwise Operation

Swapping:
a = a ^ b
b = a^b
a = b^a
Left Shift: x<< k = x* 2^k
Right shift = x >> k = x/(2^k)

Left and right shift are mostly used for finding the powers.

Top comments (0)