title: How do I optimize this Piece of code in C
body: <p>Yesterday,in an Interview I have been asked to test the 5th bit in a number(to test whether its on and off)and below is how I done it.</p>
  
  <pre><code>int number = 16;
  int mask   = 1&lt;&lt;5;
  
  if ((number &amp; mask) == 0)
      printf("Bit is off");
  else
      printf("its on");
  </code></pre>
  
  <p>but he then asked me to optimize this code and do it without using this particular mask.</p>
  
  <p>So my questions what else mask I could have used in this code?</p>