/* Merging two strings. */
#include <stdio.h>
int main()
{
char a[20], b[20];
int i, x = 0;
printf("Enter string A: ");
gets(a);
printf("Enter string B: ");
gets(b);
for(i = 0; a[i] != '\0'; i++)
x++;
for(i = 0; b[i] != '\0'; i++)
a[i+x] = b[i];
a[i+x] = '\0';
printf("String A after merging is...\n");
puts(a);
return 0;
}
Comments
Post a Comment