add chapter 4 Question 4
This commit is contained in:
parent
4ef7224ff2
commit
d986e73f12
1 changed files with 14 additions and 0 deletions
14
ch04/04.cpp
Normal file
14
ch04/04.cpp
Normal 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;
|
||||||
|
}
|
Loading…
Reference in a new issue