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.
#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;
}
Comments
Leave a comment