title: type promotion in C
body: <p>I am quite confused by the following code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdint.h&gt;
  
  int main(int argc, char ** argv)
  {
      uint16_t a = 413;
      uint16_t b = 64948;
  
      fprintf(stdout, "%u\n", (a - b));
      fprintf(stdout, "%u\n", ((uint16_t) (a - b)));
  
      return 0;
  }
  </code></pre>
  
  <p>That returns:</p>
  
  <pre><code>$ gcc -Wall test.c -o test
  $ ./test
  4294902761
  1001
  $ 
  </code></pre>
  
  <p>It seems that expression (a - b) has type uint32_t.
  I don't uderstand why since both operators are uint16_t.</p>
  
  <p>Can anyone explain this to me?</p>