I think about this problem many hours already, but solution doesn't want to come. Maybe someone have any ideas?
The question is:
"Using ONLY bitwise operators, write the function that sets the leftmost zero bit to one" Conditions - prohibited Recursion - prohibited Loops - prohibited Arithmetic operations - prohibited Example:
Input: 11010010
Output: 11110010
P.S. Input actually should be unsigned int, but for simplicity let this be as binary, it is mere details.