title: 1's complement using ~ in C/C++
body: <p>I am using Visual Studio 2013.<br>
  Recently I tried the <code>~</code> operator for 1's complement:</p>
  
  <pre><code>int a = 10;
  cout &lt;&lt; ~a &lt;&lt; endl;
  </code></pre>
  
  <p>Output is <code>-11</code></p>
  
  <p>But for</p>
  
  <pre><code>unsigned int a = 10;
  cout &lt;&lt; ~a &lt;&lt; endl;
  </code></pre>
  
  <p>the output is <code>4294967296</code></p>
  
  <p>I don't get why the output is <code>-11</code> in the case of signed <code>int</code>.
  Please help me with this confusion.</p>