while(p){
  fgets(p);
  fputs(p);
  if(p==NULL)
   break;
  fgets(p);
  fputs(p);
  if(p==NULL)
   break;
  fgets(p);
}
こんなイメージ。