In this program, the use will enter his/her first name and last name, then the full name will be displayed on console.
#include<stdio.h>
#include<string.h>
int main()
{
char fname[40], lname[20];
printf("Enter your First name: n");
scanf("%s", fname);
printf("Enter your Last name: ");
scanf("%s", lname);
strcat(fname, lname);
printf("Hello, %s\n", fname);
return 0;
}
Enter your First name: John
Enter your Last name: Smith
Hello, JohnSmith