Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created January 17, 2021 06:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/ae206d88eb36d837c23206de59b430d1 to your computer and use it in GitHub Desktop.
Save amankharwal/ae206d88eb36d837c23206de59b430d1 to your computer and use it in GitHub Desktop.
#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