title: Delay output till EOF rather than newline
body: <p>I am writing a program that copies input to output character by character on Linux terminal. The code is as follows (from Dennis Ritchie's C book)</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  /* copy input to output; 2nd version*/
  
  main()
  {
     int c;
     while ((c = getchar()) != EOF)
        putchar(c);
  }
  </code></pre>
  
  <p>The program and its execution works fine. But I want a slight modification.</p>
  
  <p>The output appears on terminal for each new line character (when I press enter). I want to delay the output till I signal the end of file by pressing <kbd>Ctrl + D</kbd>. What modifications I have to do for the program in-order to delay my output on terminal.</p>
  
  <p>Sample output I am getting is as follows:</p>
  
  <pre><code>abcd (enter)
  abcd
  llefn;elnf(enter)
  llefn;elnf
  (ctrl+d)
  </code></pre>
  
  <p>Sample output I wants to get is as follows:</p>
  
  <pre><code>abcd(enter)
  llefn;elnf(ctrl+d)
  abcd
  llefn;elnf
  </code></pre>