C++ Program to Concatenate Two Strings

C++ Program to Concatenate Two Strings.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 Program

String 1: Hi...
String 2: How are you