Friday, May 30, 2014

WRITE A PROGRAMME TO COPY ONE STRING INTO ANOTHER STRING

#include<conio.h>
#include<stdio.h>
void main()
{
char s1[20],s2[20];
int i=0;
clrscr();
printf("enter the string\n");
gets(s2);
while(s2[i])
{
s1[i]=s2[i];
i++;
}
s1[i]='\0';
printf("\n%s",s1);
getch();
}

No comments:

Post a Comment