 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can perform linear search on 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 that you can understand how we can pass array into function using pointer to perform linear search operation. So first time including a header file that is stdio.h. Now I am declaring a function whose name is search, its written type is int and it will receive two arguments. One is address and second one is an integer value. So this statement is function declaration. Now I am defining main function. Inside main function, I am declaring an array variable i, variable n and f. Then with help of printf, I am going to display the message enter 10 numbers. Then with help of follow, these 10 elements will be received and through this scanf, all the elements will be stored inside array at different indexes. Now I am using printf again so that I can read the number which I want to search. So enter the number which you want to search. This message will be displayed on console and scanf will read that number from user and that number will be stored inside n variable. Now I am calling the function search and I am passing array and variable n in it. So this statement is function calling. Here you can see search function is receiving two arguments. Base address of array through a and n will be passing its value and the result will be stored inside f. Now I have to check whether f is received one or zero. So if it is receiving one so I can print number is found else I can print number is not found. So this way I have implemented the complete definition of main which is calling search function passing array and the number which I want to search in the array. The result will be stored inside f. f is evaluated if it is one then number is found if it is zero number is not found. Now I have to define definition of search function. So this block will be known as function definition. Inside this function definition I have to implement the logic. So first time declaring variables. So here i and f both two variables are declared and f is initialized with zero. Now I am implementing a for loop which will repeat 10 times inside this for loop. I have to implement if condition which will check asterisk p with n. So understand this properly p is containing base address of the array and asterisk will provide value that is available on that address. So if that value is equals to n then I can assign one inside f and I can break the loop and if this condition is false then I have to increase p pointer so that it can point to the next location of array then I will be incremented again asterisk p. So this time p is pointing to the second location of array through asterisk its value will be received and then it will be compared with n. So if condition is true then f will receive one and loop will be terminated otherwise this process will repeat 10 times. After completion of this loop I have to return the value of f. So f will be containing zero or one. If it is containing one then number is found otherwise number is not found. So this returned value will be received at function calling statement which is available inside main. So here f will be receiving the result in form of zero and one then this if will be checking whether f is containing one or zero accordingly result will be displayed on console. So this way I have implemented how we can perform linear search on array by passing array into function using pointer. Now I am going to execute this code so that you can understand whether it is working properly or not. So I have entered 10 numbers starting from 1 to 10. I want to search 5 in this array. You can see the output it is showing number is found. Again I am going to execute this code so that I can identify another situation which is number is not found. So I have entered again 10 numbers. This time I want to search 15. You can see the output it is showing number is not found. So this way I have implemented the logic in front of you which is for linear search on array through function and pointer. If you want to watch more programming related videos 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. Thank you for watching this video.