 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 by passing array into function using pointer. 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 solution of this problem. So first time including a header file that is stdi.h. Now I am declaring two functions. First one is maximum. Its return type is integer and it will receive an argument that will be base address of array. So that's why argument type is integer pointer. So this is function declaration for minimum. Second function is declared same return type and argument type as maximum function contains. So this is also function declaration. So in this program I will be implementing two functions. One for maximum and one for minimum. So first time defining main function. Inside main function I am declaring an array, variable i, then max and min variables. With the help of printf the message enter 10 elements will be displayed on console. To read 10 numbers from user I am implementing this for loop which will repeat 10 times and it will store all the elements in a array. Now after reading operation I have to call maximum function. So max equals to maximum and inside parenthesis I am passing a array. So this statement is function calling. After this calling statement the result will be stored inside max variable. So I can print the result on console through this printf maximum equals to max. So in this function call I have passed array name. So name of array automatically pass its base address. So maximum function definition will be calculating the maximum value available in array and the result will be stored inside max. Then I have printed max on console using printf. After that I am calling minimum function and again I am passing base address of array through its name. So this is also a function call statement. Result will be received inside min variable. So I am printing that variable on console using this printf statement and then return zero. So now I have to implement two functions definition. First is maximum and second one is minimum. So first I am defining maximum function definition. So this block will be known as function definition. Inside this function I am declaring variable max which is initialized through the value 3, 2, 7, 6, 8 and variable ion. Now I am applying for loop which will repeat 10 times. Inside this loop I am going to apply the condition if asterisk p is greater than max. So asterisk p is indicating different locations of array through its address. So p is containing first time base address of the array. To receive value of that base address I am using asterisk p. So asterisk p is compared with max if the array is containing the element which is greater than max then I can assign that element into max using this statement max equals to asterisk p. So the element which is available inside array is assigned into max variable through this p pointer. After this operation I have to increase value of p through this p++. So p is containing base address. If this condition is true then value of p will be assigned into max then p will be incremented. If the condition is false then also p will be incremented so that p can point to the next locations of array. So this way I have calculated or I have find out the maximum value which is available inside array and that value is available inside max variable. Now after completion of loop I can return that max variables value to the main function where I have written the function calling statement. So this is the definition of maximum function which is implemented in front of you. Now I am going to copy these instructions. I am pasting it. Now there are two definitions maximum and maximum. So second function I am converting into minimum. So in place of max I am declaring min variable. So it is initialized with the greatest value that is 32767. Now I am comparing it with asterisk p less than min. So if the address containing value less than min then we have to assign that value into min variable. Then after this condition checking whether it is true or false we have to increase the pointer so that we can point to the remaining locations of array and after completion of sorry after completion of this loop I can return value of min to the main function. So this way I have implemented the definition of max and min functions in front of you. Now I am going to execute this code so that you can see the output. So I am entering 10 numbers. You can see the output maximum equals to 10 and minimum equals to 1. So the program is working properly. I have implemented this code by passing array into functions using pointer and I have defined two functions. One is maximum and one is minimum. I hope you have understood the logic which I have demonstrated you in this video. If this sorry if you want to watch more programming related videos you can follow or subscribe my YouTube channel through the URL youtube.com slash tanja gupta underscore tech school. You can download my programming app Techimus which is available on Google Play. Thank you for watching this video.