title: Printing short int using various format specifiers
body: <p>Please have a look at this code:  </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main(void)
  {
  short s = -1;
  
  printf("sizeof(short) = %lu\n", sizeof(short));
  printf("sizeof(int) = %lu\n", sizeof(int));
  printf("sizeof(long) = %lu\n", sizeof(long));
  printf("s = %hd\n", s);
  printf("s = %d\n", s);
  printf("s = %ld\n", s);
  
  return 0;
  }  
  </code></pre>
  
  <p>It gave output as :  </p>
  
  <pre><code>sizeof(short) = 2  
  sizeof(int) = 4  
  sizeof(long) = 8  
  s = -1  
  s = -1  
  s = 4294967295  
  </code></pre>
  
  <p>In last line why <code>s = 4294967295</code> instead of <code>s = -1</code> as through <a href="https://stackoverflow.com/questions/14748734/ambiguity-in-long-integer-arithmetic">this</a> question I came to know that In C when variable gets promoted, its value remains constant. </p>