 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can add and subtract elements of two metrics by passing 2D array 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, Takamis, which is available on Google Play. Now I am going to implement the code in C programming so that we can see the solution of this problem. So first time including a header file that is STDIO.h. Now I am declaring two functions. First one is void sum dimension of 2D array is 3 by 3. So here I will be passing two D arrays because I have to add the elements of two metrics. So this one is function declaration. Now I am popping this statement and I am pasting it. Now I am changing its name. So you can see the second declaration void sub int 2D array comma int 2D array. So both the functions will be receiving two arguments in form of 2D array of integer type. Now I am defining main function. Inside main function, I am declaring two 2D arrays A and B, then I and J variables. Now I am printing first masses using printf enter first matrix. To read this matrix, I am implementing nested loop. So here I loop will be providing row indexes and J loop will be providing column indexes. Now with the help of scanf elements entered by the user will be stored inside A matrix. So this is the reading process of first matrix that will be that elements will be stored inside A 2D array. Now I am pasting these instructions. So message will be entered second matrix and the nested loops will be same in place of A. I am using B. So this way elements of first and second matrix will be received from user. Now I am calling first function that is sum and I am passing two matrix inside it. So this statement is function calling for subtraction. I am calling another function call. So this way I have called two functions inside main function. So first one is sum and second one is subtraction. Now I am implementing first function definition that is sum. So here I am receiving two arguments and those two arguments are 2D arrays. So this is function definition. Inside this function definition I am declaring third 2D array. Now for addition purpose I am implementing again nested loops. So here I will be providing row indexes and J will be providing column indexes. Inside these loops I am applying the logic Cij equals to Aij plus Bij. So this way elements of A will be added to elements of B and the result will be stored inside C. Now I can print the elements here only. So first and D Cij. So this way all the elements of C matrix will be displayed on console. For new line I am using slash in here after completion of J loop. So this way all the elements will be displayed on console after addition and the elements are stored inside C matrix. So C will be displayed on console. Now to print subtraction I am copying this sum function definition. Now I am converting it into subtraction. So in place of addition I have applied subtraction operation inside it. So this way I have implemented the complete code in front of you. Here total three functions are available. First one is main which is reading two matrix calling sum and subtraction function. Then definition of sum function and then definition of subtraction function. So now I am executing this code. So I am entering first matrix. I have entered all elements as four. Now for second matrix I am entering all elements as two. So you can see the result. Six is printed as addition and two is printed as subtraction. Now if you want to print the messages like addition and subtraction so you can use printer slash addition and similarly here you can print subtraction. So again I am executing this code. Sorry I have I have not used semicolon here. So now I am executing this code. So I am entering four in first matrix and I am entering in second matrix. So you can see addition is six and subtraction is two. So I hope you have understood how this program is working and how I have implemented addition and subtraction functions. And here in these functions I have passed two 2D arrays. So this way I have implemented the solution of this problem. I hope you have understood the concept well. If you want to watch more programming related videos you can follow or subscribe my YouTube channel through the URL youtube.com slash sundaygupta underscore tax school. You can also download my programming app Techimage which is available on Google Play. Thank you for watching this video.