Here\'s a tough one(atleast i had a hard time :P):
find the index of the highest bit set of a 32-bit number without using any loops.
You could do it like this (not optimised):
int index = 0; uint32_t temp = number; if ((temp >> 16) != 0) { temp >>= 16; index += 16; } if ((temp >> 8) != 0) { temp >>= 8 index += 8; } ...