title: Insert blank lines in output file C programming
body: <p>I wrote a simple C program to copy the contact from input file to output one. It works fine. But now I need to insert blank lines between paragraphs in the new file and I can't get how to do this. Can anyone help me out?</p>
  
  <p>Here is code:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  #include&lt;stdlib.h&gt;
  
  void main()
  {
     FILE *fp1,*fp2;
     char ch;
  
  
      fp1 =  fopen("input.txt","r");
  
      if(fp1==NULL)
      {
          printf("\nThe file was not found.");
          exit(1);
      }
  
      fp2 =  fopen("output.txt","w");
  
      if(fp2==NULL)
      {
          printf("\nThe file was not opened.");
          exit(1);
      }
  
      while(1)
      {
         ch = fgetc(fp1);
  
         if(ch==EOF)
            break;
         else
            putc(ch,fp2);
      }
  
      printf("File copied succesfully!");
      fclose(fp1);
      fclose(fp2);
  }
  </code></pre>