Respuesta :
Answer:
#include <iostream>
using namespace std;
int main()
{
string Fname, Lname;
cout << "Please Enter your first name " <<"Please Enter Your Last Name" <<endl;
cin>>Fname>>Lname;
cout<<Lname<<", "<<Fname<<endl;
return 0;
}
Explanation:
This program is written in C++ programming Language. Firstly two string variables are declared these are Fname and Lname for first and last name respectively. C++ cout statement is used to prompt user for inputs and the cin statement is used to save the inputs in the respective variables. Using the cout operators (<<) the output is formatted as required by the question
Answer:
import java.util.Scanner;
public class SpaceReplace {
public static void main(String[] args) {
Scanner scnr = new Scanner(System.in);
String firstName;
String lastName;
firstName = scnr.next();
lastName = scnr.next();
System.out.println (lastName + ", " + firstName);
}
}
Explanation:
its kinda self explanatory