Bit Manipulation
on/off
Divide and Multiply
int a = 6;
int ans1 = a << 1;
int ans2 = a >> 1;
cout << ans1 << " " << ans2 << endl;Check if the kth bit is set or not
Check If The Number is Odd or Even
To swap two numbers
Check if a number is a power of 2
Count set bits
Find the odd occuring element
Last updated