Program No : 21 :

Write a program in C to copy one array to another array?

        program no  :21
purpose : copy one array to another array..

#include<"stdio.h">
#include<"conio.h">

void main()

{

char ch[80],copy[80];

int loop,count=0,line=0;

printf("enter the text\n");

for(loop=0,ch[loop]=getchar();
 (ch[loop]!='$' && loop<80); ch[++loop]=getchar());

ch[loop]='\0';

for(loop=0;ch[loop] ; loop++)
copy[loop]=ch[loop];

copy[loop]='\0';

printf("copy array\n");

for(loop=0;copy[loop] ; loop++)
putchar(copy[loop]);

getch();
}  
Back