C Program to Concat Two Strings without Using Library Function


Program : C Program to Concat Two Strings without Using Library Function

Program Statement :

In this C Program we have to accept two strings from user using gets and we have to concatenate these two strings without using library functions.

Output of Program :

Explanation of Code :

Our program starts from main and we are accepting two strings from user using these following statements –

Inside the concate() function we are firstly calculating the size of first string.

Now we are iterating 2nd string character by character and putting each character to the end of the 1st string.

Explanation of Program With Dry Run :

Step 1 : Input

Step 2 : Size of Strings

Step 3 : Concatenating Strings

First Character of the 2nd String will be stored at last Position of String 1. thus using for loop –