Given an unsigned integer x, find the largest y by rearranging the bits in x.
Input x = 10 Output y is 12
since 10 in binary is 1010 and 12 in binary is 1100.
MATLAB and Simulink resources for Arduino, LEGO, and Raspberry PiLearn more
Opportunities for recent engineering grads.Apply Today
New to MATLAB?Learn MATLAB today!
Play games and win prizes!Learn more