title: How do you read scanf until EOF in C?
body: <p>I have this but once it reaches the supposed EOF it just repeats the loop and scanf again.</p>
  
  <pre><code>int main(void)
  {
          char words[16];
  
          while(scanf("%15s", words) == 1)
             printf("%s\n", words);
  
          return 0;
  }
  </code></pre>