title: ouput infinite character 'p' when using fscanf in C
body: <p>I made a program to count number in input.txt:</p>
  
  <p>input.txt</p>
  
  <pre><code>13 1 17 3 14 10 18 18 16 13 15 5 5 6 12 8 8 3 2 5 4 10 11 3 1 5 10 1 7 5 6 10 9 4 3 10 15 13
  </code></pre>
  
  <p>main.c </p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main()
  {
      FILE *fptr;
      fptr=fopen("input.txt","r");
      int data;
      int count=0;
      while(!feof(fptr))
      {
          fscanf(fptr,"%d",&amp;data);
          count++;
      }
      printf("%d",count);
  }
  </code></pre>
  
  <p>And the result is infinite character 'p'  ???</p>
  
  <p><a href="https://i.stack.imgur.com/oXlv8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oXlv8.jpg" alt="https://i.stack.imgur.com/oXlv8.jpg"></a></p>