Solution :
#include [tex]${data-answer}lt; \text{stdio.h} >$[/tex]
#include [tex]${data-answer}lt; \text{stdlib.h} >$[/tex]
int [tex]$\text{main}()$[/tex]
{
[tex]$\text{FILE}$[/tex] *fp;
[tex]$\text{fp}$[/tex]=fopen("cp4in_1.txt","r");
char ch;
//while(1)
//{
while(!feof(fp))
{
char *[tex]$\text{s1}$[/tex],*[tex]$\text{s2}$[/tex],*[tex]$\text{s3}$[/tex];
[tex]$\text{s1}$[/tex] = (char*) [tex]$\text{malloc}$[/tex]([tex]$20$[/tex] * [tex]$\text{sizeof}$[/tex](char));
[tex]$\text{s2}$[/tex] = (char*) [tex]$\text{malloc}$[/tex]([tex]$20$[/tex] * [tex]$\text{sizeof}$[/tex](char));
[tex]$\text{s3}$[/tex] = (char*) [tex]$\text{malloc}$[/tex]([tex]$40$[/tex] * [tex]$\text{sizeof}$[/tex](char));
[tex]$\text{int i}$[/tex]=0,j=0,x,y;
while(1)
{
ch=getc(fp);
if(ch=='\n')
break;
*(s1+i)=ch;
i++;
}
while(1)
{
ch=getc(fp);
if(ch=='\n')
break;
*(s2+j)=ch;
j++;
}
for(x=0;x<i;x++)
{
*(s3+x)=*(s1+x);
}
for(y=0;y<j;x++,y++)
{
*(s3+x)=*(s2+y);
}
for(x=0;x<i+j;x++)
{
printf("%c",*(s3+x));
}
printf("\n");
getc(fp);
}
}