Specify a certain bit 1
x |= (1 << y);
Specify a certain bit 0
x &= ~(1 << y);
Specify the reverse of a certain bit
x ^= (1 << y);
Get the value from a certain bit
((x >> y) & 1);
x |= (1 << y);
x &= ~(1 << y);
x ^= (1 << y);
((x >> y) & 1);