 Hello friends, I am Sanjay Gupta. In this video I am going to demonstrate you how you can find out minimum and second minimum from 2D array. Before starting, you can follow or subscribe my YouTube channel through the URL youtube.com slash sanjaygupta underscore tech school. You can download my programming app Techimates which is available on Google Play. Now coming on to the topic, here I am going to implement a code in C programming. So first I am including a header file. Then inside main function, I am going to implement the code. So here I am declaring a 2D array. Then IJ variable. Then I am initializing min width 3, 2, 7, 6, 6 and second min width 3, 2, 7, 6, 7. These are the largest elements of integer range. Then printf will display enter elements message on console. Now I am implementing first for loop which will repeat 3 times and it will provide row indexes. Inside this for loop, I am implementing another for which will also repeat 3 times and it will provide column indexes. Now to receive elements, I am using scanf. This scanf statement will store the elements in 2D array. Now I am applying the logic if a of IJ is less than min. So if this condition is true, it means array element is less than minimum. So the current minimum will become second min. So I am assigning min into S min. Now min will be receiving the element which is available inside 2D array. So this way I have implemented first condition if array element is less than min. So the min will become second minimum and the array element will become the new minimum. If this condition is false, then I am applying another if which will check a of IJ with second min. So if a of IJ is not less than S min, then it will be checked with, sorry, if a of IJ is not less than minimum, then it will be checked with a of IJ with second minimum. So if a of IJ is less than second minimum and a of IJ is not equals to minimum, if both the conditions are true, then a of IJ will be assigned into second minimum. So this way I have implemented the logic. After completion of these loops, I can print the result on console with minimum equals to percent D and second minimum equals to percent D, then min comma S min. So this way I have implemented the complete code which will find out the minimum and second minimum value available in 2D array. Now I am executing this code. I am entering all the elements of 2D array. You can see the result. Minimum is 1 and second minimum is 2. So the program is working properly. It is printing the correct results on console. I hope you have understood the logic well how you can find out minimum and second minimum from 2D array. If you want to watch more programming related videos, you can follow or subscribe my YouTube channel through the URL youtube.com slash sando Gupta underscore tax school. You can download my programming app Techimage which is available on Google Play. Thank you for watching this video.