title: char in buffer preventing input of integer
body: <pre><code>#include &lt;stdio.h&gt;
  
  int main(void) {
      int n,m=5;
      char c;
      while(m&gt;0)
      {
          m--;
          scanf("%d",&amp;n);
          if(n==42)
          break;
          printf("%d",n);
          fflush(stdin);
          scanf("%c",&amp;c);
          puts(&amp;c);       
      }
      return 0;
  }
  </code></pre>
  
  <p>Although I know that when a enter is pressed after entering a number at first <code>scanf</code>, it(enter) is taken as input by the second <code>scanf</code>, but my doubt is that, when I give <code>5ttttt</code> as input , the output is </p>
  
  <pre><code>5t
  5t
  5t
  5t
  5t
  </code></pre>
  
  <p>as there is no integer in input buffer, why it is not asking for input of integer|
  Second question is, even if we follow the above behavior, then on giving input of <code>5t</code> and then pressing enter should take two characters as buffer ('t' and 'enter') but only t is taken in buffer and the output is</p>
  
  <pre><code>5t
  </code></pre>
  
  <p>but I expected the output</p>
  
  <pre><code>5t
  5
  </code></pre>
  
  <p>as 'enter' would be taken in buffer and it will not ask for integer input in the second iteration of loop. </p>