#include<stdio.h>
void main(void)
{
char str1[25],str2[25];
int i=0,j=0;
printf("
Enter First String:");
gets(str1);
printf("
Enter Second String:");
gets(str2);
while(str1[i]!=' ')
i++;
while(str2[j]!=' ')
{
str1[i]=str2[j];
j++;
i++;
}
str1[i]=' ';
printf("
Concatenated String is %s",str1);
}
Explanation: