how to enter person's last name and first name seperated by space and comma

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nikkicorrea
    New Member
    • Dec 2012
    • 1

    how to enter person's last name and first name seperated by space and comma

    how to enter person's last name and first name seperated by space and comma. for example henry smith---output-->>smith,henry
  • whodgson
    Contributor
    • Jan 2007
    • 542

    #2
    In C++ you could do something like this.
    prompt: enter given name
    cin>>given_name ;
    prompt: enter surname
    cin>>surname;
    cout<<surname<< ", "<<given_name<< endl;

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      This is not a code writing service. But if you post your code along with any errors you get and a description of what you're looking for, we can help guide you to an answer.

      Comment

      Working...