#include
#include
#include
char *con(char *s1,char *s2);
char *input();
int main()
{
char *s1,*s2;
int i=0;
printf(“Enter string 1:”);
s1=input();
printf(“Enter string 2:”);
s2=input();
// strcat(s1,s2);
s1=con(s1,s2);
printf(“Concatination is: %s\n”,s1);
}
char *input()
{
char *s,ch;
int i=0;
s=(char *)malloc(sizeof(char));
while(1)
{
scanf(“%c”,&ch);
// ch=(char *)malloc(10*sizeof(char));
s=realloc(s,(i+2)*sizeof(char));
if(ch==10)
break;
s[i]=ch;
i++;
}
return s;
}
char *con(char *s1,char *s2)
{
int i=0,j=0;
for(i=0;i<20;i++)
{
if(*(s1+i)=='')
{
*(s1+i)=*(s2+j);
j++;
}
}
return s1;
}