title: ^Z character is written to the file or not?
body: <p>I am writing text to a file using the following program.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  int main()
  {
      int ch;
      FILE *fp;
      fp = fopen("myfile.txt", "w");
  
      if(fp == NULL)
      {
          printf("Error opening file\n");
          exit(1);
      }
  
      printf("Press Ctrl+D to stop \n\n");
  
      printf("Enter text: ");
  
      while( (ch=getchar()) != EOF )
      {
          fputc(ch, fp);
      }
  
      fclose(fp);
  
  }
  </code></pre>
  
  <p>Let's say the input is:</p>
  
  <pre><code>Press Ctrl+D to stop \n\n
  
  Enter text: this is a test
  ^Z
  </code></pre>
  
  <p>My question is the end of file character (ASCII value 26) will be written to the file or not ?</p>