Reverse bits of a digit
Anonymous
I think you should reverse bits of an integer. If you have only a 8 bit integer then you can make like this: int reverse(int x) { x = ((x & 0xAA) >> 1) | ((x & 0x55) > 2) | ((x & 0xCC) > 4) | ((x & 0x0F) << 4); return x; }
Check out your Company Bowl for anonymous work chats.