 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how can concatenate two strings by passing strings into function. Before starting, you can note my information, you can follow or subscribe my YouTube channel through the URL youtube.com slash sanjaygupta underscore tech school. You can download my programming app TechMess which is available on Google Play. Now I am going to implement solution of this problem. So first time including header file that is stdio.h. Now I am declaring a function whose name is concat. Its written type is void and it will receive two arguments of type character array. So this is function declaration. Now I am defining main function inside main function. I have to declare two character arrays. So name of character arrays are s1 s2. Now I have to receive both the strings from user. So this printf will display the message enter first string on console. Now through gattus the contents of s1 will be received from user. Now through second printf the message enter second string will be displayed on console and through gattus the contents of second string will be stored inside s2. Now after reading operation I have to call the concat function in which I am passing both the strings s1 and s2. So this statement is function call. After completion of this calling process the results will be available inside s1. So I can print the s1 string using this printf statement. So the output will be displayed with this printf and it will display the message concatenated string equals to the output which will be displayed with the help of s1 and then return 0. So this way I have implemented the definition of main function. Now I am going to define the definition of concat function. So here you can see I have received both the arguments in s1 and s2 strings. So this is function definition. Inside this function definition I have to provide the logical part of concatenation. So I am declaring variables i and j and variable c which is initialized with 0. Now I am applying a loop which will depend upon s1 string. So here you can see I am counting how many characters are available in s1. So it is counted with the help of c variable. It is incremented every time whenever this loop will be repeating. Then s1 of i not equals to 0 if this condition is true then loop will repeat otherwise it will be terminated. So after completion of this loop counted element will be available inside c variable. Now for concatenation purpose I am starting another loop. Here I am initializing i with c and j with 0. Its condition will be dependent upon s2 string and i++, j++. Inside this loop I have to apply the statement s1 of i equals to s2 of j. So with this way I am copying contents of s2 string into s1. So notice that i is starting from c. So c is counted the number of characters which are available in s1. So i is pointing to the last location of the s1 string and j is starting from 0. So 0th index of s2 string will be copied on last position of s1 then i and j both are incremented. So this way all the contents of s2 will be copied inside s1 at the end of this s1 string. After completion of this loop I have to copy null character in s1 string. So for that purpose I have implemented this statement. So this is the complete definition of concat function which is concatenating contents of s1 and s2 and the result will be assigned inside s1. Now I am going to execute this code. So it is asking for first string I am entering Sanjay. It is asking for second string I am entering Gupta. You can see the output concatenated string equals to Sanjay Gupta. So this way I have concatenated both the strings by passing strings into function. I hope you have understood how I have implemented this program which is concatenating two strings by passing strings into function. If you want to watch more programming related videos you can follow or subscribe my YouTube channel through the URL youtube.com slash sanjaygupta underscore tech school. You can also download my programming app TechMS which is available on Google Play. Thank you for watching this video.