title: Exercise 1-6: (page 17 K&R) - getchar() question
body: <p>When I run the program below, output give second 1. I debug the program, but I couldn't understand why compiler writing second 1 anytime?</p>
  <p><a href="https://i.stack.imgur.com/a257v.png" rel="nofollow noreferrer">output like this.</a></p>
  <pre><code>#include &lt;stdio.h&gt;
  
  main()
  {
  int c;
  
  while (c = getchar() != EOF)
      printf(&quot;%d\n&quot;, c);
  printf(&quot;%d - at EOF\n&quot;, c);
  }
  </code></pre>