#include<stdio.h>
#include<string.h>intmain(){chara[20],b[20];printf("———————————————————————————————————————————");printf("\nProgram to concatenate the two strings");printf("\n———————————————————————————————————————————");printf("\nEnter the 1st string ");scanf("%s",a);printf("\nEnter the 2nd string ");scanf("%s",b);strcat(a,b);printf("\nThe concatenated string is %s",a);printf("\n———————————————————————————————————————————\n");return0;}
Output
codeaft@codeaft:~$ gcc codeaft.c codeaft@codeaft:~$ ./a.out
———————————————————————————————————————————
Program to concatenate the two strings
———————————————————————————————————————————
Enter the 1st string KODING
Enter the 2nd string WINDOW
The concatenated string is CODEAFT
———————————————————————————————————————————
codeaft@codeaft:~$
Dear User, Thank you for visitng Codeaft. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.