95: Take input of user first name and last name and join the name and output full name. (join two strings)
#include <iostream>
using namespace std;
string stjoin(string string1,string string2)
{
return string1 + ' ' + string2;
}
int main()
{
string fname, lname, full_name;
cout << "Enter your first name: ";
getline(cin, fname);
cout << "Enter your last name: ";
getline(cin, lname);
full_name=stjoin(fname, lname);
cout << full_name;
return 0;
}
Comments
Post a Comment