 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can find out maximum and minimum element from an array by passing array into 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 coming onto the topic, I am going to implement a code in C programming which will find out maximum and minimum values from array and I am going to pass array into function. So first I have included a header file, then I am going to declare two functions. First one is maximum and second one is minimum. So in this program, I am defining two user defined functions. So these both are function declarations. After that, I am implementing main function. Inside main, I am declaring an array i and m variables. Then with the help of printf, I am going to show the message, enter 10 numbers on console. Then for loop, it will repeat 10 times and with the help of scanf, it will receive 10 elements from user. Now first I am going to call maximum function and I am passing a array into into it. So this statement is function calling the return value will be received inside m variable. So after receiving the maximum, I am going to show this on console with the help of printf. Now I am calling another function that is minimum. Again, I am passing array a inside it. So this is also known as function calling statement. It will also receive value that is minimum available in array in m variable. So I am again printing it with the help of printf. So minimum equals to percent d and the value is available inside m. And at last I am implementing return zero. So this is the complete definition of main, which is calling two separate functions. First is maximum and second one is minimum. After implementation of main, first I am going to define the definition of maximum function. This block will be known as function definition. Here I am declaring two variables i and m and m is initialized with negative value. So it is the negative number and it is the smallest negative number of integer range. So it will be compared with array element. If array element is greater than m, then array element will be assigned into m. So for that purpose, first I have to implement for loop. Inside for loop, I am going to compare a of i with m. So if array element is greater than m, then m will be receiving that array element. So because array element is greater than m, so array element will become the maximum value. After completion of this loop, maximum will be available inside m variable. So I can return m to the main function. So this is the complete definition of maximum function. Now I am going to define another function, which is minimum. So this block is also known as function definition. So this is second function. So first function was maximum and second function is minimum. So again here I am declaring two variables. But this time I am assigning the largest element of integer range into m because I have to identify minimum value. So for that purpose, I am implementing a for loop. This for loop will repeat 10 times and inside this loop, I am implementing a condition a of i less than m. So if array element is smaller than m, then m will be receiving that array element. So this way, if condition will be checked 10 times, so if array element is less than m, then that array element will be assigned into m variable. After completion of loop, m will be containing the smallest element. So I am returning it to the main function. So this way, two functions maximum and minimum are implemented. Both are returning a single value and the result will be stored inside the calling statement and inside m variable and m will be displayed using printf on console. So now I am executing this code. You can see it is asking for 10 numbers. So I have entered 10 different numbers. You can see the output maximum equals to 10 and minimum equals to 1. So this way you can see here in this program, total three functions are implemented main, maximum and minimum and all three functions are working properly. So friends, you can implement any number of functions in a C program and you can pass array into any particular function as argument. So I hope you have understood all the concepts which I have explained 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 kukta underscore tech school. You can download my programming app Techimiz which is available on Google Play. Thank you for watching this video.