C Programming

C program to concatenate two strings With Algorithm

Concatenation of two strings means to add two strings and make it a single unit or term. In c programming, we can easily concatenate two strings using strcat() function. This is a special type of function available in string.h library. It is generally used to add two strings. For the implementation of strcat() function in our program, firstly we have to declare the header file which includes that function.

In simple words, concatenation of two string means adding two strings to make it one.

For example:

1st string – Super

2nd string – Computer

Concatenated string – SuperComputer

Algorithm- ( concatenate two strings in C)

  1. Start
  2. Accept 1st string.
  3. Accept 2nd String.
  4. Concatenate the strings.
  5. Print the result.
  6. End

Program to concatenate two strings using strcat() function


int main()
char str1[20],str2[20];
printf("Enter the first string :\n");
printf("Enter the secode string :\n");
printf("The concatenated string is %s\n",str1);


Leave a Reply

Your email address will not be published.