Write a program to read two strings and append second to first


#include<stdio.h>
#include<string.h>
int main()
{

char str1[40];
char str2[40];
printf(“Enter the first string:n”);
gets(str1);
printf(“Enter the second string:n”);
gets(str2);
strcat(str1,str2);
printf(“String 1 is now:n”);
puts(str1);
return 0;
}

One thought on “Write a program to read two strings and append second to first”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s