title: What happens if I assign a negative value to an unsigned variable?
body: <p>I was curious to know what would happen if I assign a negative value to an unsigned variable.</p>
  
  <p>The code will look somewhat like this.</p>
  
  <pre><code>unsigned int nVal = 0;
  nVal = -5;
  </code></pre>
  
  <p>It didn't give me any compiler error. When I ran the program the <code>nVal</code> was assigned a strange value! Could it be that some 2's complement value gets assigned to <code>nVal</code>?</p>