C++ Program to Print Full Name of User

In this program, the use will enter his/her first name and last name, then the full name will be displayed on console.

Source Code
using namespace std;

int main()
    char fname[40], lname[20];

    cout<<"Enter your First name: ";
    cin>> fname;
    cout<<"Enter your Last name: ";
    cin>> lname;

    strcat(fname, lname);
    cout<<"Hello, " << fname;
    return 0;
Enter your First name: John
Enter your Last name: Smith
Hello, JohnSmith