How can I toggle all bits of a number except after the highest set bit?
For Example: Let's suppose a 32-bit number that needs to be toggled.
00000000000000000010011110000100 // Input
00000000000000000001100001111011 // Expected
How could I achieve this in a java/C++??