title: C programming - unsigned int overflow problem
body: <p>I want to print out an integer type variable which value is 3000000000;</p>
  
  <p>So I wrote the below code then ran it, but the printed value was incorrect. I think the variable is overflowed. But I don't know why.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main(void) {
      unsigned int num1 = 3000000000;
  
      printf("%d", num1);
  }
  </code></pre>
  
  <p>As far as I know, <strong>the maximum value of unsigned integer type variable is (2^32-1 = 4,294,967,296 - 1)</strong> when the code complies on Win32 API.
  <strong>But the printed value is -1294967296.</strong></p>
  
  <p>I have no idea why overflow occurs in my code.</p>
  
  <p>If anyone knows the reason, please let me know :)</p>
  
  <p>Best regards,</p>
  
  <ul>
  <li>I use Microsoft Visual Studio 2015 Professional.</li>
  </ul>