Answer:
// here is code in c++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variable declaration
string firstname,lastname;
// ask to enter first name
cout<<"enter the first name:";
// read firs tname
cin>>firstname;
// ask last name
cout<<"enter the last name:";
// read last name
cin>>lastname;
// print the output
cout<<"hello "<<firstname<<" "<<lastname<<endl;
return 0;
}
Explanation:
Part 1, declare variables "firstname" and "lastname".Part 2, Ask user to enter first and last name.Part 3, read the value of first and last name and assign to variables "firstname" and "lastname" respectively.Part 4, Print "hello" followed by first name and last name.
Output:
enter the first name:robert
enter the last name:doweny
hello robert doweny