/************************************************************************ * * * Program: ReverseNames.cpp * * * * Author: Robb T. Koether * * * * Date: Sep 9, 2003 * * * * Purpose: This program will read a first and last name and print * * them in reverse order * * * ************************************************************************/ // Header files #include #include using namespace std; /************************************************************************ * * * Function: main * * * * Purpose: To reverse a first and last name * * * ************************************************************************/ int main() { // Get the first and last names from the user cout << "Enter the first and last names: "; string firstName; string lastName; cin >> firstName >> lastName; // Print the names in reverse order cout << "The name is " << lastName << ", " << firstName << endl; return 0; }