bit in c++ code example Example: bit c++ Set ith bit: x|(1<<i) Get ith bit: (x&(1<<i) != 0) Clear ith bit: x&(~(1<<i))