 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can count frequency of a character in string. 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 coming on to the program, I am going to implement the solution of this program with the help of C programming. So first I am including a header file that is stdr.h. Then inside main, I am declaring a character array str whose size is 10 and then a character variable n. Then a variable i and c will be initialized with 0. Now with the help of printf, the message enter string will be displayed on console and to receive string, I am using GATUS. After this, I am applying printf statement again which will display the message enter the character which you want to count. So I am reading that character with the help of scanf %c, m%n. So n variable will be containing the character which I want to count. Now for logic, I am applying for loop which is initialized with 0 and its condition is str of i not equals to null. So if this condition is true, then loop will be repeated otherwise it will be terminated. Inside this loop, I am applying the condition str of i double equals to n. So if this condition is true, it means n, the character which I want to count is available in the string. Then I am applying c++ so c will be incremented by 1 if this condition is true and after completion of this loop, c will be incremented if the condition is true otherwise it will remain 0. So now after completion of loop, I can print the value of c as total equals to %d. So c will be printing how many times a particular character is available in the string and then returns 0. So this way I have implemented the complete code in front of you which will count the frequency of a character in a string. So I am executing this code. I am entering Sanjay Gupta and I am entering a. So you can see it is counting a is available three times. So a is available twice in Sanjay and one time in Gupta. So it is counting the character properly. So I hope you have understood the code well how this code is counting how many times a character is available in a string. If you want to watch more programming related videos, you can follow or subscribe my YouTube channel through the URL youtube.com. You can download my programming app Techimace which is available on Google Play. Thank you for watching this video.