Assume that name has been declared suitably for storing names (like “Misha”, “Emily” and “Sofia”) Write some code that reads a value into name then prints the message “Greetings, NAME ” where NAME is replaced the value that was read into name . For example, if your code read in “Rachel” it would print out “Greetings, Rachel”.

LANGUAGE: C++

CHALLENGE:

Assume  that name  has been declared  suitably for storing names  (like “Misha”, “Emily” and “Sofia”) Write some code that reads a value  into name  then prints the message  “Greetings, NAME ” where NAME  is replaced the value  that was read into name .  For example, if your code read in “Rachel” it would print out “Greetings, Rachel”.

SOLUTION:

The Bad News: The content you are trying to access is only available to members.

The Good News: You too can be a member, simply Click Here.

Already a member?

Posted in ,

4 Comments

  1. Anonymous on September 22, 2014 at 9:05 pm

    just remove the ;

    cin >> name;
    cout << "Greetings, " << name;

    • Matthew Maennche on September 23, 2014 at 7:09 am

      I am curious as to why we need to remove a semicolon, these are two separate operations?

  2. Anonymous on September 22, 2014 at 9:06 pm

    remove the pre*

    • Matthew Maennche on September 23, 2014 at 6:59 am

      Good Catch, I am not sure why that bit of HTML was showing through but I took care of it. Thanks for the feedback.

Leave a Comment

You must be logged in to post a comment.