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
#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;
}
Output
Enter your First name: John
Enter your Last name: Smith
Hello, JohnSmith





"Coding Hub - Learn to code" app now available on Google Play Store