 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can find and replace element in 1D array. Before starting, you can note my information. You can visit or subscribe my YouTube channel through the URL youtube.com slash sanjaygupta underscore tax pool. You can download my programming app Takim is available on Google Play and you can connect me connect with me by following the details which are available in front of you. Now coming on to the topic, here in this video, I am going to implement a program in C language, which will find a particular element and that will be replaced by another element. So for that purpose, I am including a header file that is stdio.h. Then I am implementing main function. Inside main function, I am declaring an array. Then N1, N2 variables and then I. Now with the help of printf, I want to show this message on console that is enter 10 numbers. To receive 10 numbers, I am implementing a for loop which will repeat 10 times and this loop will repeat scanf statement. So with the help of this for loop and scanf, 10 elements will be received from user and those 10 elements will be stored at different indexes inside a array. Now I am again implementing a printf statement which will ask enter the number you want to replace scanf %e and %n1. So n1 will receive the number which user wants to replace. Again printf enter the number which you want to place. So to receive this number, I am again using scanf and this time m%n2. Now you can see, first of all I have received 10 elements inside array using this printf for loop and scanf. Then using another printf scanf segment, I am receiving the number which user want to replace or you can say user want to find the number that will be replaced by another number. Then again printf and scanf is written. This printf is showing the message enter the number which you want to place instead of the number which user wants to replace. So in short n1 will be find out and it will be replaced by the value which is stored inside n2. So n1 will be replaced by the value which is stored inside n2. So now for this purpose, I am again implementing for loop. Now here I am implementing if condition that is a of i double equals to n1. So if array element that is stored in a of i is equals to n1. So it means that number should be replaced. So for that purpose, I am writing a of i equals to n2. So if a of i is equals to n1, then a of i will be containing n2. So n1 will be replaced by n2. So this way, all the elements which are equals to n1 will be replaced by n2. Now after completion of this loop, I have to print the updated array. So with this printf, the message updated array will be displayed on console. Now to display all the elements, I am implementing this for loop along with printf. So this printf will display all the elements which are available inside array on console at last return 0. So friends, this is the complete implementation which will find out a particular number and that number will be replaced by the another number. Now I am going to execute this code. You can see it is asking for 10 numbers. So I am entering 1, 2, 3, 4, 5, 1, 2, 3, 4, 5. Now it is asking for the number which you want to replace. So I am entering 1. Now it is asking the number which you want to place in place of 1. I am entering 9. You can see the output. At first position earlier there was 1. This time 9 is available and at second position after 5, 1 was available. This time it is showing 9. You can see the entered array. 1 is available twice and this time 1 is replaced with 9. So this way I have applied find and replace on 1D array. A particular number has been found out and that number is replaced by another number. So the number which I want to find out is available in n1 variable and that number is replaced by the value which is available inside n2 variable. So I hope you have understood the concept behind this program. If you want to watch more programming related videos, you can follow this URL youtube.com slash sanjay gupta underscore tag school. You can also download my programming app tag MS which is available on google play. So keep connected with me and learn programming because programming is very easy. It is a fun. Thank you for watching this video.