How to Concatenate Multiple Strings in C? Last Updated : 17 Jun, 2024 Comments Improve Suggest changes Like Article Like Report In C, concatenating strings means joining two or more strings end-to-end to form a new string. In this article, we will learn how to concatenate multiple strings in C. Example: Input:char str1[50] = "Hello";char str2[50] = " geeksforgeeks";Output:Hello geeksforgeeks!Concatenating Strings in CTo concatenate strings in C, we can use the strcat function from the string.h library. The strcat function appends the source string to the destination string. C Program to Concatenate Multiple StringsThe below example demonstrates the use of the strcat function to concatenate multiple strings in C. C // C program to concatenate multiple strings #include <stdio.h> #include <string.h> int main() { // creating string variables char str1[50] = "Hello"; char str2[50] = " geeksforgeeks!"; char str3[50] = " How are you?"; printf("Initial strings:\n%s\n%s\n%s\n", str1, str2, str3); // Concatenating strings strcat(str1, str2); strcat(str1, str3); printf("String after concatenation: %s\n", str1); return 0; } OutputInitial strings: Hello geeksforgeeks! How are you? String after concatenation: Hello geeksforgeeks! How are you? Time Complexity: O(n)Auxiliary Space: O(1) Comment More infoAdvertise with us Next Article How to Concatenate Multiple Strings in C? R rohitpant4532 Follow Improve Article Tags : C Language C-String C Examples Similar Reads Concatenating Strings (combining multiple strings into one) Given two strings str1 and str2, the task is to concatenate these two strings. Given two strings str1 and str2, the task is to concatenate these two strings. Examples: Input: str1 = "hello", str2 = "world"Output: helloworld Input: str1 = "Geeks", str2 = "World"Output: GeeksWorld Approach 1: Using th 4 min read Shell Script to Concatenate Two Strings String concatenation is the process of appending a string to the end of another string. This can be done with shell scripting using two methods: using the += operator, or simply writing strings one after the other. The examples below show some shell scripts that can be used to concatenate strings. E 3 min read Batch Script - String Concatenation String Concatenation is combining two or more strings to create a new string. For instance, let a string "Good" and take another string "Morning" now by string concatenation i.e. "Good" + "Morning" and we got new string i.e. "Good Morning". This is string concatenation. Let see some examples of stri 2 min read How to write long strings in Multi-lines C/C++? Image a situation where we want to use or print a long long string in C or C++, how to do this? In C/C++, we can break a string at any point in the middle using two double quotes in the middle. Below is a simple example to demonstrate the same. C #include<stdio.h> int main() { // We can put tw 2 min read Python String Concatenation String concatenation in Python allows us to combine two or more strings into one. In this article, we will explore various methods for achieving this. The most simple way to concatenate strings in Python is by using the + operator.Using + OperatorUsing + operator allows us to concatenation or join s 3 min read Like