while(ch!=EOF) { while((ch=fgetc(stream1))!='\n') { str[i++]=ch; } str[i]=0; for (int k=0; k