im trying to stick two strings together without using + operator,also using loops to to that.the problem is after when it read two strings it couldnt print the second string and only the first string appears.
here is my code
this code is like copying two strings in one.

```
char str1[MAX];
char str2[MAX];

cout<<"Enter The first String:\n";
cin.getline(str1,MAX,'\n');
cout<<"Enter the second String:\n";
cin.getline(str2,MAX,'\n');

char str3[2*MAX];   int k=0;

for(int i=0;i<MAX;i++)
{ str3[k]=str1[i];  k++;    }
for(int j=0;j<MAX;j++)
{ str3[k]=str2[j];  k++;    }

str3[k]='\0';
cout<<endl<<"Here is the concatenated string:\n";
cout<<str3<<endl;

```