title: Complement 32 bit data
body: <pre><code>int a=1;
  
  // a=1 in binary representation 0000 0000 0000 0000 0000 0000 0000 0001
  
  int b =~a; 1111 1111 1111 1111 1111 1111 1111 1110
  
  printf("%d",b)
  </code></pre>
  
  <p>output = -2.</p>
  
  <p>why output is -2</p>
  
  <p>32 bits--  0-31.</p>
  
  <p>31st bit is signed bit. signed bit = 0 if no is +ve, 1 if no is -ve.</p>
  
  <p>Since 1 has moved to 31st bit . if signed bit is 1 is no -ve. Then why value 2 </p>
  
  <p>Is my understanding correct. If not guide me</p>