Program to show String concatenation without using string function in C Language.



//String concatenation without using string function
//www.lernc.blogspot.com

#include
#include

main()
{
int i,l;
char a[15],b[30];
clrscr();
i=0;
printf("\n Given first string \n");
scanf("%s",a);
printf("Given second string \n");
printf("www.lernc.blogspot.com");
scanf("%s",b)
l=strlen(b);
while(a[i]!='\0')
{
b[l+i]=a[i];
i++;
}
b[l+i]='\0';
printf("\n Concatenated string is %s",b);
}

5 comments: