C Program to Concatenate Two Strings Using strcat()

Concatenating two strings in C program involves combining them to create a single string. Here’s a simple C program that concatenates two strings.

Program :

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char input1[80];
char input2[80];
printf(“Enter the first string: “);
gets(input1);
printf(“Enter the second string: “);
gets(input2);
strcat(input1,input2);
puts(input1);
}

Output :

Leave a Comment

Your email address will not be published.

Shopping Basket
Verified by MonsterInsights