title: Swap every pair of bits in byte
body: <p>This was a question asked by an NVIDIA representative at a career fair:</p>
  
  <p>Write small, efficient code to swap every pair of bits inside a byte; for example, <code>10 11 01 10</code> should become <code>01 11 10 01</code>.</p>
  
  <p>Is there any more "efficient" way to do this than by doing a <code>for</code> loop through every other index? My code was small, but I can't think of how much more "efficient" this could possibly get than a loop... I'm guessing there might be a way to use XOR to avoid a loop, but I can't figure it out.</p>
  
  <p>Thanks!</p>