Answer to Question #188872 in C++ for Asad

Question #188872

Write a program that take input two strings from the user, you have to concatenate the strings and store the result in third string.


1
Expert's answer
2021-05-08T14:28:04-0400
#include <iostream>


using namespace std;


int main()
{
    cout << "Enter first string: ";
    string firstString;
    getline(cin, firstString);


    cout << endl << "Enter second string: ";
    string secondString;
    getline(cin, secondString);


    string thirdString = firstString + secondString;
    cout << endl << "Output: " << thirdString;


    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS