title: Bitwise NOT in C
body: <p>I have a simple application:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(int argc, char **argv)
  {
    unsigned int a = 0x2; //= 10b
    unsigned int b = ~a;  // should be 01b
    printf("%04x : %04x\n", a, b);
  }
  </code></pre>
  
  <p>I wonder, why does it print <code>0002 : fffffffd</code> instead of <code>0002 : 0001</code>?</p>