 Hello friends. I am Sanjay Gupta. In this video, I am going to demonstrate you how you can search whether a particular element is present in a matrix or not. Before starting, you can note my information. You can follow or subscribe my YouTube channel through the link youtube.com slash Sanjay Gupta underscore tech school. You can download my programming app Techimus, which is available on Google Play. Now coming on to the topic. Here I am implementing a code in C programming so that I can demonstrate you how we can search whether a particular element is available in a matrix or not. So I am declaring a 2D array, then I, J and N variable and one more variable F, which is initially zero. Then with the help of printf, I am going to print a message, enter elements on console. Now to read elements, I am using master loops. So I will be representing row indexes and J will be representing column indexes. These loops will repeat scanner statement to read elements from user. So this way reading of 2D array is implemented. Now I am going to use printf again. Now this printf will display enter the number you want to search. This message will be displayed on console and scanner will read the number which user want to check whether it is available in matrix or not. After reading that number again I am implementing nested loop. So this time nested loop will be checking whether the number is available in matrix or not. So again I will be representing column sorry row index and J will be representing column indexes. Inside J loop I am applying if condition which will check whether aij is equals to N. So if this condition is true then I am assigning 1 into F and I am breaking the loop. So you can see here the logic if aij is equals to N then only F will become sorry F will become 1 and loop will be terminated. If this if condition will be false every time then value of F will remain 0. So now after completion of these loops I have to check the value of F whether it is 1 or 0. So if F is equals to 1 then I can say number is available in 2D array. So I can print the message number is present. Otherwise I can print F which will show number is not present. So this way I have implemented the complete code in front of you. It is checking whether the particular number is present in 2D array or matrix or not. Now I am executing this code. You can see it is asking for numbers. So I am entering elements in 2D array. Now it is asking for the number which I want to search. I have entered 5. You can see it is showing number is present. So code is working properly. Now again I am executing this code. It is asking for numbers. I am entering numbers. Now it is asking for the number which I want to search. So this time I am entering 10 which is not available in 2D array. So you can see the message number is not present. So this way I have implemented the code in front of you which is checking whether a particular number or element is present in matrix or not. So I hope you have understood the code well. If you want to watch more programming related videos you can follow 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.