title: Why the while function becomes infitine loop? (C Code)
body: <pre><code>    int a=0, x, y, status;
      
      FILE *file;
      file = fopen(&quot;C:\\Users\\user\\Desktop\\input.txt&quot;, &quot;r&quot;);
      if(file == NULL)
      {
          printf(&quot;There is no file...&quot;);
          return 0;
      }   
  
      while(1)
      {   
          status = fscanf(file, &quot;%d %d&quot;, &amp;x,&amp;y);
          a++;
          if (status == feof(file))
              break;
      }
      
      printf(&quot;%d&quot;, a);
      fclose(file);
      getch();
      closegraph();
  }
  </code></pre>
  <p>I wanted to hide that how many times the while function work in a variable and print it then. The while loop becomes infinite loop and i could not solve it.</p>
  <p>input.txt file: <a href="https://i.stack.imgur.com/YCQi7.png" rel="nofollow noreferrer">input.txt</a></p>