#include <stdio.h>
#include <conio.h>
#include <string.h>
main()
{
char s1[30],s2[20];
int i,length = 0,temp;
printf("enter string 1: ");
gets(s1);
printf("\n enter string 2: ");
gets(s2);
for(i=0;s1[i]!='\0';i++)
length++;
temp = length;
for (i=0; s2[i]!= '\0';i++)
{
s1[temp] = s2[i];
temp++;
}
s1[temp] = '\0';
printf("\nThe concatenated string is \n");
puts(s1);
getch();
}
No comments:
Post a Comment