 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can calculate some of individual rules and columns of a matrix by passing 2D array into a function. Before starting, you can note my information. You can follow or subscribe my YouTube channel through the URL youtube.com slash sanjaygupta underscore tax school. You can download my programming app tag image, which is available on Google Play. Now I will be implementing the solution of this problem with the help of C programming. So first I am including a header file that is stdio.h. Now I am declaring two functions. First one is row sum, where I will be passing a 2D array of dimension 3 by 3. So this is function declaration. Another declaration for column sum. Again here, I will be passing a 2D array of dimension 3 by 3. And this statement is also a function declaration. So here you can see in both the functions, I will be passing a single argument in form of 2D array and return type is void. And here you can see I have mentioned dimensions of 2D array because in case of 2D array, we have to write these dimensions while we are passing 2D array into function. Now I am implementing main function. Inside main, I am going to declare a 2D array and then IJ variables. Now with the help of printf, the message enter elements will be displayed on console. Now I am implementing nested loops so that I can read values of 2D array. So with the help of this nested loop, I can read elements from user with the help of scanf statement. So this is the reading process. Now I am calling first r sum where I am passing a. So this is function call. Then I am passing column sum and again I am passing a 2D array. So this is function call. So first row sum function will be called after completion of the process of row sum function. Column sum function will be called. So this is the complete implementation of main. After that I have to implement first r sum function definition for that purpose. I am implementing this block. So this block will be known as function definition. So inside this function, I am declaring some variables. Now I have to implement nested loops so that I can apply the process. Here i loop will be providing low indexes and j will be providing column indexes. Now inside j loop, I am applying s equals to s plus a ij. So j loop will be calculating sum of rows after completion of j loop. I have to apply a printf statement so that I can print the result on console. So sum equals to percent d s. Now I can also add the row index. So sum of percent d row is and here I am applying i plus one. So in case of programming indexes start from zero but for user row number one is one. So that's why I have applied i plus one. So it will print sum of first row is the sum which is available inside s. Then after printing this I have to assign zero into s so that new sum of second row will be available inside this s variable. So again i plus plus will be performed and when j will be repeated three times for second row the sum will be calculated into s variable and then with the help of printf sum of second row will be displayed. So this process will repeat till the sum will be displayed on console. So this is the function which will print row sum on console. Now I am copying these instructions and I am pasting and I am changing the name of this function. So here you can see total two functions are available. First one is row sum and second one is column sum. In case of column sum I am just changing the indexes here. In place of i I am using j and in place of j I am using i. So if I add aj i into s then it will calculate column sum. So here I am applying sum of first and d column is. So this way I have implemented the complete code in front of you which will print a sum of individual rows and sum of individual columns on console. Now I am going to execute this code. So you can see it is asking for values. Now you can see the result. Sum of first row is six. So one plus two plus three equals to six. Sum of second row 15. Sum of third row is 24. So all the results are correct. Now sum of first column so one four seven seven plus four eleven plus one twelve. So it is also correct. Then sum of second column is two five eight eight five thirteen plus two fifteen and then three six nine is equals to eighteen. So here you can see all the sums of individual rows and columns are displayed with the help of 2d array and function. So here I have implemented two separate functions and in both the functions I have passed 2d array through main function. So this way I have implemented this code in front of you so that you can understand how we can pass 2d array in two different functions in c programming. I hope you have understood the whole logic. If you want to watch more programming related videos you can follow or subscribe my youtube channel through the url youtube.com slash sanjay gupta underscore tech school. You can download my programming app TechMS which is available on google play. Thank you for watching this video.