Seperating text files :   Im trying to read a text file called myfile.txt and copy lines 2,4,6 into a text file called even.txt and copy lines 1,3,5 into odd.txt.im new to progrmming and this is probably vry wrong.Any help woould be appriciated.

     int main()
      {
  
     FILE *fp;
     FILE *feven;
     FILE *fodd;

     
     int lines = 0;
  
      fp = fopen("myfile.txt","r");
       if (fp ==NULL) {
       printf("Cannot open file.\n");
       exit(1);
        }
 
        feven = fopen("even.txt","w");
         if (feven ==NULL) {
         printf("Cannot open file.\n");
         exit(1);
      }
  
       fodd = fopen("odd.txt","w");
        if (fodd ==NULL) {
         printf("Cannot open file.\n");
         exit(1);
        }
    
  
	while (fscanf(fp, "%s") != EOF) {
        lines ++;
		if (lines%2=0)
		{fprintf(feven,"%s \n");}
		else
		{fprintf(fodd,"%s \n",);}
	}
		}  //end while
	}//end program