 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can perform linear search operation using dynamic memory location in C programming. Before starting, you can note my YouTube channel, how you can search it. You can type my name Sanjay Gupta on YouTube search bar. My channel will be available there. You can watch various programming related videos there. You can also download my Android app, Tachymes which is available on Google Play. Now I am going to implement solution of this problem with the help of dynamic memory location. So first time including a header file that is a stdio.h then another header file that is a stdialib.h. Now I am going to define main function. Inside main function, I am declaring a pointer p, variable n, i, variable item and f variable which is initialized with 0. Now to receive size of array, I am going to display the message enter size using printf. Then scanner will read that size from user and the value will be stored inside n variable. Now I have to perform dynamic memory location. So for that purpose, I am calling malloc function. So malloc will allocate required amount of memory. So this statement is dynamic memory location where malloc will be allocating n into size of n memory and the returned address will be typecasted into integer pointer and that will be stored inside p pointer. Now through p, I can access all the locations of that memory. So for that purpose, first I am going to display the message enter elements. Now with the help of this for loop, I can receive all the entered elements from user through this scanner statement. So here notation is p plus i. So p is having base address. I have added i in this p pointer every time. So p plus i will be providing different locations of that memory and value will be stored at those locations using this scanf. After reading n numbers from user, I am again using printf which will display the message enter the number you want to search. So that number will be received through scanf and that will be stored inside item variable. So now I have read all the elements that will be stored inside array and the item which I want to search. Now after this, I am going to apply a for loop which will repeat n times and inside this for loop, I have to apply if condition. So this if will be checking whether element of array is equals to item or not. So for finding out element of array, I am using at risk p plus i. So p plus i will be providing address. Then through asterisk, it will be de-referenced and then it will be compared with item variable. So if it is equal, then I am assigning one into f variable and I am using break keyword which will terminate the rotation of loop. So if this condition is true which is available at line number 19, then only f will become one otherwise it will remain zero and then loop will be terminated. After completion of this loop, I have to check whether the value of f is one or zero. If it is one, then I can print the message number is available. Otherwise, I can print the message number is not available. At last, I can call free function which can destroy the allocated mabby to p pointer and then return zero. So this way I have implemented the complete code in front of you. Now I am going to execute this code. It is asking for size. I am entering six. So I have to enter six elements. So I have entered one, two, three, four, five, six. Now it is asking for the number which I want to search. So I am entering four. You can see the result. It is showing number is available. Now again I am executing this code. This time I am entering the size four and I have entered one, two, three, four and I am entering five, which I want to search. So it is showing the output number is not available. So this way I have executed the program in both the ways whether the number is available or not. And you can see that I have entered different size of elements while I have executed this code. So after while execution is started, it will receive size first, then that desired number of elements will be received, then the number which you want to search will be received and then the required result will be displayed. So this way I have performed linear search operation using dynamic memory location in C programming. I hope you have understood the logic well. You can type my name in YouTube search bar. Sanjay Gupta, if you want to watch more programming related videos, my channel will be available there. So keep watching programming related videos. Don't forget to subscribe my YouTube channel. Thank you for watching this video.