title: C - Determining all if all even bits are set to 1
body: <p>Determine if all even place bits (counting from left to right) are set to 1. For instance, <code>0101 0101</code> would count whereas <code>1011 1000</code> would not count.</p>
  
  <p>If the the bit has 1's in all even places, return 1, or else return 0.</p>
  
  <p>Constraints: must only use bitwise operators. Cannot use conditionals. Biggest integer you can use in an expression is <code>0xFF</code>.</p>
  
  <p>Here is my code: </p>
  
  <pre><code>int allEvenBits(int X) {
      int x1 = !((X &amp; 0x55) ^ 0x55);
      int x2 = !(((X &gt;&gt; 8) &amp; 0x55) ^ 0x55);
      int x3 = !(((X &gt;&gt; 16) &amp; 0x55) ^ 0x55);
      int x4 = !(((X &gt;&gt; 24) &amp; 0x55) ^ 0x55);
      return x1 + x2 + x3 + x4;
  </code></pre>
  
  <p>}</p>
  
  <p>The above returns 1 for the following: <code>1011 0010 1001 0010 1011 1001 1111 1111</code></p>
  
  <p>How can I modify this to make it work with the constraint?</p>