 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you can find out maximum edit from 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 tech school. You can download my programming app Techimus which is available on Google Play. Now I am going to implement a code in C programming in front of you which will find out maximum and minimum from a matrix and I will be passing the 2D array into the function. So first I am declaring a function which will find out maximum. So this statement is function declaration. In this function name of function is maximum its return type is int and it will receive an argument which which will be of type integer and it is a 2D array. Now for minimum again I am declaring a function. So this is function declaration again in this function return type is integer name of function is minimum and it will also receive a 2D array of integer type. Now I am defining main function. Inside main function first I am declaring a 2D array then IJ and then a variable M. Now printf statement is available which will display the message enter elements on console to read elements of 2D array. I am implementing nested loop. So here I loop will provide row indexes and J loop will provide column indexes to read elements from console. I am implementing scanf which will assign elements at different indexes of a matrix. So this is the reading process of 2D array after implementation of the code for reading of elements. I am calling first function that is maximum. So this statement is function calling statement here maximum function is called then a 2D array is passed inside this function and the result will be received inside M variable. Now I can display the output on console. So with the help of this printf maximum value will be displayed on console. Now after this I am calling minimum function through this printf minimum will be displayed on console and this is function calling statement. So this way I have implemented the complete main function definition after defining main first I have to implement definition of maximum function. So this block is function definition inside this function I am declaring some variables. So ij and m variables are declared m is initialized with the smallest number of integer range that is minus three two seven six eight. Now I am applying nested loop. So these nested loops will be implementing the logical part. As you can see I have implemented two loops one is I and second one is J. So I will be providing row indexes and J will be providing column indexes. So inside this loop I am applying the logic if a of ij is greater than max. So if this condition is true it means array element is greater than max. So if a of ij is greater than m then I can assign a of ij into m variable because it will be the current maximum. So this way this complete nested loop will process and each element of matrix will be compared with m. If aij is greater than m then its element will be assigned into m variable after completion of this loop. I can return m so this return value will be received inside main function at the statement of function call. So function calling will be received the return value and the printf will display the output on console. Now I am copying this maximum function definition and I have pasted it. Now I am converting it into minimum. So here I have to assign the largest element of integer range and in place of greater than I am applying less than. So this is the second definition which will calculate minimum. So here if aij is less than m then aij will be assigned into m variable and after completion of this nested loop the value of m will be returned. So this way I have completed the program. Now I am executing this code. I am entering numbers. You can see the output maximum is 9 and minimum value is 1. So this way the program is working properly. I have passed 2d array into the function and I have implemented total two functions. First is maximum and second one is minimum. So I hope you have understood the logic or all the implementation which I have demonstrated 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.