hello-world.cpp
· 214 B · C++
Raw
#include <iostream>
#include <string>
using namespace std;
int main() {
string name;
cout << "\nWhat is your name (first and last)? ";
getline(cin, name);
cout << "\nHello, " << name << endl;
return 0;
}
| 1 | #include <iostream> |
| 2 | #include <string> |
| 3 | using namespace std; |
| 4 | |
| 5 | int main() { |
| 6 | string name; |
| 7 | cout << "\nWhat is your name (first and last)? "; |
| 8 | getline(cin, name); |
| 9 | cout << "\nHello, " << name << endl; |
| 10 | return 0; |
| 11 | } |