 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can calculate sum of two 1D arrays by passing arrays 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 TechMS which is available on Google Play. Now I am going to implement a code with the help of C programming so that we can add values of two 1D arrays using function. So first I am declaring a header file, then a function I am going to declare name of function is in its sorry name of function is sum its return type is void and it will receive two arguments of integer type array. So this statement is function declaration. Then I am defining main function. Inside main I am declaring two arrays A and B. Then with the help of printf I am going to display the message enter 10 elements for first array. Then I am implementing for loop which will repeat 10 times it will repeat scanf statement so that 10 elements can be stored inside A array. So this way with this with these three statements first array elements will be stored inside A. Now I am copying these statements and I am pasting the elements sorry I am pasting the instructions. So now printf will be printing enter 10 elements for second array and here in place of A I am using B. So first array and second array elements will be received through this logic. Now I am passing both the arrays into function. So this is function calling and then return 0. So this is the complete definition of main function. Now I am providing definition of some function. So this block will be known as function definition. Inside this function I am declaring another variable or you can say array C and variable I. Now I am implementing for loop which will repeat 10 times. Inside this for loop I am going to add elements of A and B and the result will be stored inside C. This is the logic A I plus B I and the result is stored inside C of I. Now I am going to display values in stored inside C of I. So this way I have implemented the complete definition of some function which is adding elements of A and B. Results are stored inside C array and then printf is printing the elements which is available inside C array. So C array is containing some of A and B. Now I am executing this code. You can see it is asking for elements of first 10. So I am entering 1 at each location. Now it is asking for elements of second array. So I am entering 4 at each location of 2d array. You can see the result. 5 is printed 10 times. So this is the sum of first and second 1d arrays. Now in place of C I can remove this C in place of C array. I can use directly this statement A of I plus B of I inside for loop. So here I do not require any third loop for storing addition because I am printing addition of A and B arrays directly on console with the help of printf. So now again I am executing this code. I am entering 1 in first array. I am entering 4 in second array. Sorry, got terminated. So I am entering 1 in first array and 4 in second array. You can see the result. 5 is displayed 10 times. So this way I have removed third array that is C and I have directly printed sum of A and B on console. So if you want to save a number of variables then you can use this method. But if you want to store addition into third location so that that third array can be used for further processing then you have to declare C array in this program. So I hope you have understood how we can pass 2 1d arrays into function in C programming. If you want to watch more programming related videos you can follow or subscribe my YouTube channel through the URL youtube.com slash sanjaybukta underscore tech school. You can download my programming app TechMS which is available on Google Play. Thank you for watching this video.