Question #261260

1.     Write C++ statements that prompt the user to enter a person’s last name and then store the last name into the variable name.


Expert's answer

#include <iostream>

int main()
{
    std::cout << "Enter the last name: ";

    std::string name;
    std::cin >> name;

    std::cout << "Last name is '" << name << "'\n";

    return 0;    
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS