A simple C program which concats two strings. the second string appends to first string and forms a concatenated string. Here string concatination is done using strcat() function. Look below for program and the screenshot, |
PROGRAM :
#include<stdio.h> #include<string.h> int main() { char string1[50], string2[50]; printf("\nEnter First string :"); gets(string1); printf("\nEnter Second string :"); gets(string2); strcat(string1,string2); printf("\nConcatenated string is :%s\n", string1); return (0); }
OUTPUT :
C Program - String concatenation using strcat() |