title: Shifting only 1 bit in an integer by a specific number of places
body: <p>I am creating a chess program and for the board representation I am using bitboards. The bitboard for white pawns looks like this:  </p>
  
  <p><code>whitePawns=0x000000000000FF00;</code>  </p>
  
  <p>Now, if I want to move the white pawn on the square D4, I would have to shift the 12th bit by either 8 or 10 places so that it can get on to the next rank. I want to shift the 12th bit without disturbing the positions of the remaining bits. How do I do that?  </p>
  
  <p>After shifting the whitePawns variable should look this:  </p>
  
  <p><code>whitePawns=0x0000000008F700;</code></p>