 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 an array. Before starting, you can note my information. You can follow or subscribe my YouTube channel through this URL youtube.com slash sanjaygupta underscore tech school. You can download my programming app TechMS which is available on Google Play. Now coming on to the topic, here you can see I have implemented some instructions. Here array A of 10 is declared. Then min and asmin variables are initialized with highest values available for integer range 32766 and 32767. Then I have received 10 elements through this for loop and scanf inside A array. After reading 10 elements, I am going to find out minimum and second minimum from the array. So I am starting I from zero condition is I less than 10 so loop will repeat 10 times. Inside this loop, I have to apply first if that is A of I is less than min. So if A of I is containing value that is less than min. So the current min will be assigned into second min and min will be receiving the value which is stored inside A of I. So here you can see that the current minimum is now second minimum and A of I, which is the current minimum that must be assigned into min variable. Now, if this condition is false, that means A of I is not less than minimum. So here inside else, I am going to check that if A of I is less than asmin. So if A of I is not equals to minimum, sorry, if A of I is not less than min, so this condition will be false. So inside else, another if is available, which is checking A of I is less than second minimum. So here I am assigning A of I into second minimum. Here I have to add another condition that is if A of I is less than min, if A of I is less than min, then this condition will be true. If A of I is not less than min, then control will be transferred to the second if here if A of I is less than asmin and A of I is not equals to minimum. Then only A of I will be assigned into asmin. Now, this is the complete loop, which is checking which is comparing A of I with min and asmin. So if it is less than min, then it will be assigned into minimum variable and if A of I is less than asmin and A of I is not equals to min, then only A of I will be assigned into second minimum. After completion of this loop, I can print the result on console. So minimum equals to percent D and second minimum equals to percent D then comma min comma asmin. So this is the complete code which is available in front of you. Now I am going to execute this code. So you can see here I have to enter 10 numbers. So I am entering 10 different numbers. You can see the output minimum is one and second minimum is two. So out of these 10 numbers, the smallest element is one and the second minimum element is two. So you can see the program is working properly. It is calculating the proper minimum and second minimum which are available inside array. So I hope you have understood how you can find out minimum and second minimum values which are available inside array in C programming. If you want to watch more programming related videos, you can follow my YouTube channel through the URL youtube.com slash sanjay gupta underscore tax pool. You can also download my programming app Techness which is available on Google Play. So keep connected with me and learn programming. Thank you for watching this video.