title: Unexpected values when used unsigned int with %u and %x
body: <p>Today I'm working on a sample iOS application in which there is a code like:</p>
  
  <pre><code>unsigned int uCount = 0;
  int iJoke = -7;
  uCount = uCount + iJoke;
  </code></pre>
  
  <p>But when I printed it like:</p>
  
  <pre><code>╔══════════════════╦══════════════════════╦════════════╗
  ║ Format Specifier ║   Print Statement    ║   Output   ║
  ╠══════════════════╬══════════════════════╬════════════╣
  ║ %d               ║ NSLog(@"%d",uCount); ║ -7         ║
  ║ %u               ║ NSLog(@"%u",uCount); ║ 4294967289 ║
  ║ %x               ║ NSLog(@"%x",uCount); ║ fffffff9   ║
  ╚══════════════════╩══════════════════════╩════════════╝
  </code></pre>
  
  <p>I expected the output of %u as 7.</p>
  
  <p>Then I used like:</p>
  
  <pre><code>unsigned int i = 0;
  int j = -7;
  i = i + abs(j);
  </code></pre>
  
  <p>And output is like:</p>
  
  <pre><code>╔══════════════════╦══════════════════════╦════════╗
  ║ Format Specifier ║   Print Statement    ║ Output ║
  ╠══════════════════╬══════════════════════╬════════╣
  ║ %d               ║ NSLog(@"%d",uCount); ║      7 ║
  ║ %u               ║ NSLog(@"%u",uCount); ║      7 ║
  ║ %x               ║ NSLog(@"%x",uCount); ║      7 ║
  ╚══════════════════╩══════════════════════╩════════╝
  </code></pre>
  
  <p>Although my issue is fixed with <code>abs()</code>, I'm curious to know why the %u gave <code>4294967289</code> as result in my first case.</p>
  
  <p>Please help, Thanks in advance. </p>