add chapter 4 Question 4

This commit is contained in:
kuoi 2022-08-25 00:44:15 +01:00
parent 4ef7224ff2
commit d986e73f12
1 changed files with 14 additions and 0 deletions

14
ch04/04.cpp Normal file
View File

@ -0,0 +1,14 @@
# include <iostream>
# include <string>
using namespace std;
int main(){
string f_nm, l_nm, nm;
cout << "Enter your first name: ";
getline(cin, f_nm);
cout << "Enter your last name: ";
getline(cin, l_nm);
nm = f_nm + ", " + l_nm;
cout << "Here is the information in a single string: " << nm << endl;
return 0;
}