Question: Can you please explain the login behind this problem. Specifically, why we have to x&1 at the end for this function to work. Thank you!
Can you please explain the login behind this problem. Specifically, why we have to x&1 at the end for this function to work.
Thank you!
* allEvenBits - return 1 if all even-numbered bits in word set to 1 Examples alLEvenBits(OXFFFFFFFE) = 0, aLLEvenBits(0x55555555) -1 *Legal ops:!-& A| > *Max ops: 12 *Rating: 2 int allEvenBits(int x) I x- x& (x>>16); return x
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
