 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how we can find out some of positive and negative elements present in a matrix by passing a 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 TechMS which is available on Google Play. Now I am going to implement the solution of this problem. So first time including a header file stdio.h then I am declaring a function. This statement is function declaration. So here you can see name of function is thumb, its return type is void and it will receive an argument that is 2D array of integer type. Then I am defining main function inside this main function. First I am declaring a 2D array then IJ variables. Now I am implementing printf which will display the message enter elements on console to receive elements from user. Now I am implementing nested loop. So here I will be providing row indexes and J will be providing column indexes. To receive these elements, I am applying scanf then m percent aij. So this is the reading process. After completion of reading, I can call some where I am passing a matrix. So this is function calling and then I am using return zero. So now I have implemented the complete main function definition. After that I am defining definition of sum. So here return type is void and I am receiving an argument that is 2D array. So this block will be known as function definition. Inside this function definition I am declaring some variables. So IJ variables are declared and S1 and S2 are initialized with zero. Now again I am implementing nested loops. So here I will be providing row indexes and J will be providing column indexes. Now inside these loops I am going to implement the logic. So I am checking if aij is greater than zero. So if this condition is true, then number is positive. So I can add S1 equals to S1 plus aij. If this condition is false, then I have to check if aij is less than zero. So if this condition is true, it means number is negative. So I am adding it into S2. So this way I have implemented both the logics. If aij is greater than zero, then aij will be added into S1. Otherwise it will be checked whether aij is less than zero. So if number is negative, then it will be added into S2. After completion of both the loops, I can print the addition on console with the help of printf. So sum equals to percent d then slash n negative sum equals to percent d then S1 comma S2. So this way I have implemented the definition of sum function and the program is implemented properly. Now I am going to execute this code. So here I am entering some positive and some negative values. So now you can see the result. Positive sum is 16 and negative sum is minus 14. So now check it. Positive numbers are 1, 4, 6, 2 and 3. So 1 plus 4 is 5. 5 plus 6 is 11 then plus 2, 13 plus 3, 16. So positive sum is correct. Now add all the negative numbers. So negative numbers are 3 minus 3 minus 5. So minus 3 minus 5, 8 plus minus 2 minus 10 and then minus 4. So minus 14. So a negative sum is minus 14. So you can see the program is working properly. So this way I have passed a 2D array into function for calculating sum of positive and negative numbers present in a matrix. So I hope you have understood how I have implemented this code in front of you. If you want to watch more programming related videos, you can follow or subscribe my YouTube channel through the URL youtube.com. You can download my programming app TechMS which is available on Google Play. Thank you for watching this video.