 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can find out maximum and minimum from an array using pointers. Before starting, you can note my information, you can follow or subscribe my YouTube channel through the url youtube.com slash tanjaygupta underscore tech school. You can download my programming app TechMS which is available on Google Play. Now, I am going to implement a code with the help of C programming, which will find out maximum and minimum element available in array with help of pointers. So I am including a header file that is stdiv.h, then I am defining main function. Inside main, I am declaring an array pointer p, then a variable max, which I am initializing with 3, 2, 7, 6, 8 and the variable min, which I am initializing with 3, 2, 7, 6, 7 and then I. So after declaring these variables and pointers, I am using printf statement which will display the message enter 10 elements on console. To receive all the elements from user, I am implementing a follow which will repeat 10 times and it will read all 10 elements and those elements will be stored inside array A. Now I am assigning address of array into p pointer. So you have to remember that name of array provides base address of array. So here if I if I am writing p equals to a, it means base or beginning address of array is assigned into p pointer. So now I can access all the locations of array through this pointer. To identify maximum and minimum, I am again implementing a for loop. Now inside this for loop, I am going to access the locations of array through pointer so that I can find out maximum and minimum value. So for that purpose, I am using if condition that is asterisk p is greater than max. So here asterisk p is representing element of array. So right now it is representing first location value. So if first location value is greater than max, then I have to assign that value into max variable. So for that purpose, I am writing max equals to asterisk p. Now I have to compare asterisk p with minimum. So if asterisk p is less than min, then min should be containing the value available at asterisk p location. So this way I have compared location of array with max and min variables. If first condition is true, then asterisk p will be assigned into max. If second condition is true, then asterisk p will be assigned into minimum. After that, after that, I have to move to another locations of array. So for that purpose, I have incremented p pointer by one. So by using p++, I can access each location of array. So this loop will be repeating 10 times. So 10 different locations will be processed through pointer. So here in this loop, I am not using array. I am using its pointer. Now after completion of this loop, I can print the values of max and min variable on console. So maximum equals to %d and minimum equals to %d, then max, min. So with this way, the results will be displayed on console. Now I am going to execute this code. I am entering 10 different numbers. So you can see the output maximum equals to 10 and minimum equals to one. So this way you can see I have processed all the locations of array with the help of pointer and I am able to find out the maximum and minimum values which are available inside inside array with the help of pointer. I hope you have understood the concept which I have demonstrated in this video. 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 Tech immense which is available on Google Play. Thank you for watching this video.