Wap in C To Concatenate Two Given String Without Using The Library Function Strcat( ).
#include<stdio.h>
#include<conio.h> void strconc(char*,char*); char *s3; void main() { char *str1,*str2; clrscr(); printf("\n enter the first string:"); gets(str1); printf("\nenter the second string:"); gets(str2); strconc (str1,str2); printf("\n The New string is :%s",s3); getch(); } void strconc(char*s1,char*s2) { int ls1,ls2,i; ls1=strlen(s1); ls2=strlen(s2); s3=s1; for (i=0;i<ls2;i++) { s3[ls1++]=s2[i]; } s3[ls1++]=NULL; } |