-
-
Save amankharwal/ae206d88eb36d837c23206de59b430d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<string> | |
using namespace std; | |
int main(){ | |
string prompt("What is your name? :"), | |
name, | |
line(40, '-'), | |
total = "Hello "; | |
cout<<prompt; | |
getline(cin, name); | |
total = total + name; | |
cout<<line<<endl<<total<<endl; | |
cout<<" Your name is "<<name.length()<<" characters long."<<endl; | |
cout<<line<<endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment