To clear bit (make it 0) in number , you AND with the complement of . In code: .
Why? The expression creates a number with all bits set to 1 except bit , which is 0. ANDing with this mask turns off bit while preserving all others.
Example: Clear bit 2 in . Compute . Bit 2 is now off.