 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can count frequency of a particular number which is entered by the user in a matrix. 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 TechMS which is available on Google Play. Now, I am going to implement the code in C programming so that you can understand the concept. So, first I am including header file, then I am implementing main function. Inside main, I am declaring a 2D array, then IJ variables, then a number and C for counting purpose. It is initialized with 0. Now, with the help of printf, I am going to display a message, enter elements on console. To receive elements from user, I am applying nested loops. So, here I loop is representing low indexes and column loop will be representing column indexes. Sorry, J loop will be representing column indexes. Now, to receive elements, I am applying scanf. Scanf will read all the elements entered by the user and all elements will be stored inside a matrix. Now, I have to read the number which I want to search in matrix and I want to count the frequency of that number, that how many times it is available in the matrix. So, enter the number which you want to count. I am reading that number with the help of scanf inside n variable. Now, I have to apply the logic. So, for that purpose, I am again implementing nested loop. So, first I have implemented I loop, then I am implementing J loop. So, I will be representing row indexes and J will be representing column indexes. Now, I have to apply the logic, if ij w equals to n. So, if this condition is true, it means number is available in a matrix at ij index. So, I can apply c++. So, it is counting that number is present in a 2D array or matrix. So, if this if condition is true, aij w equals to n, then only c will be incremented by 1. So, whenever this condition is true, c will be increasing its value. So, after completion of both the loops, c will be having the count that how many times a particular number that is stored inside n variable is available in matrix. So, after completion of loop, I can print that value on console. So, element is present % times and I am printing value of c. Then at last I am applying return 0. So, this way I have implemented the complete code which can count the frequency of a particular number entered by the user in a matrix. Now, I am executing this code. So, I am entering values. So, I have entered 1, 2, 3, 1, 2, 3, 1, 2, 3 in each row. Now, it is asking for the number which I want to count. So, I have entered 2. You can see it is showing element is present 3 times. So, the program is working properly. It is out. It is counting the frequency of a particular number which is entered by the user in a matrix with the help of 2D array. So, I hope you have understood the concept well how you can count frequency of a particular number which is available in a matrix. 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 tax pool. You can download my programming app Techimates which is available on Google Play. Thank you for watching this video.