HomeC++

Write C++ Program to Concatenate Two Strings

Write C++ Program to Concatenate Two Strings
Like Tweet Pin it Share Share Email

Hi,Today we make program About strings.Now Start to make C++ Program to Concatenate Two Strings.

C++ Program to Concatenate Two Strings

#include <iostream>
using namespace std;
int main()
{
string s1, s2, result;
cout << "Enter first string: ";
getline (cin, s1);
cout << "Enter second string: ";
getline (cin, s2);
result = s1 + s2;
cout << "The concatenated string is= "<< result;
return 0;
}

Output of ProgramC++ Program to Concatenate Two Strings

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *