Learning
Computer
Programming
Computer
Programming
Program No : 22 :
Write a program in C to merge to arrays?
program no :22
purpose : merge two array
#include<"stdio.h">
#include<"conio.h">
void main()
{
char ch[80],ch1[80],copy[80];
int loop,cloop;
printf("enter the text first\n");
for(loop=0;(ch[loop]=getchar())!='$'; ++loop);
ch[loop]='\0';
fflush(stdin);
printf("enter the text second\n");
for(loop=0;(ch1[loop]=getchar())!='$'; ++loop);
ch1[loop]='\0';
for(loop=0,cloop=0;ch[loop]; loop++,cloop++)
copy[cloop]=ch[loop];
copy[cloop]='\0';
for(loop=0;ch1[loop]; loop++,cloop++)
copy[cloop]=ch1[loop];
copy[cloop]='\0';
printf("merger array\n");
for(cloop=0;copy[cloop] ; cloop++)
putchar(copy[cloop]);
getch();
}




