title: find if a number is divisible by 8 - using bit shifting operators
body: <p>I was recently asked during an interview, using just bit shift operators, write some code that would tell you if a number is divisible by 8, apparently the code is very short - does anyone have a clue?</p>
  
  <p>Note: if you aren't required to use shifts, you'd test the low <code>n</code> bits for being all-zero with a mask like <code>x&amp;7 == 0</code>, or more generally 
  <code>x &amp; ((1UL &lt;&lt; n) - 1) == 0</code>.  <a href="https://stackoverflow.com/questions/748673/how-can-i-tell-if-a-number-is-a-multiple-of-four-using-only-the-logic-operator-a">How can I tell if a number is a multiple of four using only the logic operator AND?</a></p>