Exchange the odd and even bits of an integer
Anonymous
You have to get the odd and the even bits (using the & operator with 0xaaaaaaaa and 0x55555555). Then just shift the even to the right (>>1) and the odd to the left (<<1). Finally, result = newodd | neweven
Check out your Company Bowl for anonymous work chats.