Escolar Documentos
Profissional Documentos
Cultura Documentos
#include<fstream.h>
#include<conio.h>
int main()
clrscr();
ifstream f1;
ofstream f2;
f1.open("story.txt");
f2.open("alt.txt");
int ctr=0;
char ch[20];
while(!f1.eof())
f1>>ch;
if(ctr%2==0)
f2<<ch<<" ";
ctr++;
f1.close();
f2.close();
getch();
return 0;
}
OUTPUT
Story.txt
Alternate.txt