title: Most efficient way to find the index of the only '1' bit in a char variable (in C)
body: <p>This is an interview question:<br>
  You are given a char variable named <code>ch</code>, when you know that it represents a number that in its binary form, only one of its eight bits will be equal to '1'. I.E. , the only possible values for <code>ch</code> are: <code>0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80</code>.<br>
  Given the variable <code>ch</code>, I need to write the most efficient code to get the index of that '1' bit. For example: if <code>ch == 0x1</code> -> result is 0. if <code>ch == 0x4</code> -> result is 2.          </p>
  
  <p>The obvious way is to use switch-case, but I need something more efficient.<br>
  Is there any bit manipulation you can do here for efficient implementation?</p>