title: overflow short int in language C
body: <p>I'm trying to make a program that show short int overflows in C. In my program you enter two short int and I add them. If the addition is superior to 32767 we have a negative overflow and if the addition is inferior to -32678 we have a positive overflow. </p>
  
  <p>Now my problem is that my program refuses to respect any of the condition when using <code>if</code>. But when I use <code>do while</code> my program consider that I respect the two condition at the same time.</p>
  
  <pre><code>short int n1, n2, somme;
  printf("Enter the first number: ");
  scanf("%hi", &amp;n1);
  printf("enter the second number : ");
  
  scanf("%hi", &amp;n2);
  
  somme= n1 + n2;
      do
      {
      printf("negative overflow\n");
      }while (somme&gt;32767);
      do
      {
      printf("negative overflow\n");
      }while ( somme&lt;-32768);
  
  printf("the result is %hi", somme);
  </code></pre>
  
  <p>Sorry for my english.  and thanks for reading, please help.</p>