Skip to main content
added 132 characters in body
Source Link
anon
anon

Try it like this?

cout << "Enter your name: ";
cin >> name;
cout << name << endl;

cout << "your name is: " << name << endl;

Here's how it looks on my end after compiling:

$ echo "foo" | ./a.out 
Enter your name: foo
your name is: foo

Note:
Haven't used C++ in ages!

Try it like this?

cout << "Enter your name: ";
cin >> name;
cout << name << endl;

cout << "your name is: " << name << endl;

Note:
Haven't used C++ in ages!

Try it like this?

cout << "Enter your name: ";
cin >> name;
cout << name << endl;

cout << "your name is: " << name << endl;

Here's how it looks on my end after compiling:

$ echo "foo" | ./a.out 
Enter your name: foo
your name is: foo

Note:
Haven't used C++ in ages!

added 23 characters in body
Source Link
anon
anon

You have no << endl inTry it like this line:?

cout << "Enter your name: ";

Try this:

cin >> name;
cout << "Entername your<< endl;

cout << "your name is: " << name << endl;

Note:
Haven't used C++ in ages!

You have no << endl in this line:

cout << "Enter your name: ";

Try this:

cout << "Enter your name: " << endl;

Try it like this?

cout << "Enter your name: ";
cin >> name;
cout << name << endl;

cout << "your name is: " << name << endl;

Note:
Haven't used C++ in ages!

Source Link
anon
anon

You have no << endl in this line:

cout << "Enter your name: ";

Try this:

cout << "Enter your name: " << endl;