title: Printing the value of EOF
body: <p>In Kernighan and Ritchie (the C programming language):</p>
  
  <p>'Write a program to print the value of EOF'</p>
  
  <p>I wrote:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  main(){
  
      int c;
      c = getchar();
      if ((c = getchar()) ==  EOF)
          putchar(c);
  }
  </code></pre>
  
  <p>but it doesn't output anything Why?</p>