Bitwise Left Shifts
The left-shift operator causes the bits in shift-expression to be shifted to the left by the number of positions specified by additive-expression. The bit positions that have been vacated by the shift operation are zero-filled.
The left-shift operator causes the bits in shift-expression to be shifted to the left by the number of positions specified by additive-expression. The bit positions that have been vacated by the shift operation are zero-filled.
In the kth bit set/unset problem, we first write the algorithm, then some pseudocode, and then implement the solution.
This problem is similar to the last lesson we discussed. If you need a clue, return to the previous lesson to further your understanding.
In the kth bit set/unset problem, we need to write a program that checks whether the kth bit of a number is 1 or 0.