 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can count frequency of a particular character available in a string by passing string into function. 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 tech image which is available on Google Play. Now I am going to implement solution of this problem with the help of C programming. So first time including a header file that is stdi.h. Now I am declaring a function whose name is count. Its written type is integer and it will receive two arguments as input. One is character array and another one is character variable. So this is function declaration. Now I am defining main function. Inside main function I have declared a character array str and character variable ch. One more variable c which is of integer type. Now with the help of printf, I am going to display the message enter string on console. The entered string will be received by gattus and the content will be stored inside str. Now again I am using printf statement which will display the message enter the character which you want to count. And that character will be received using scanf c and that character will be stored inside ch variable. Now I have to call the count function and I am passing str and ch inside it and the return value will be received inside c variable. So this statement is function call. After receiving value inside c, I can print the result on console. Total availability of that character is c. So I have printed it with the help of printf on console and then return 0. This is the definition of main function. Now I am defining count function definition which will receive two arguments. First is character array and second one is character variable. So this block is function definition. Inside this function definition, I am declaring two variables i and c. C is initialized with 0 which will count frequency of a particular character. To apply the logic, I am implementing for loop which is initialized with 0. The loop termination condition is str of i not equals to 0 and then i++. Now inside this loop, I have to apply the logic if str of i double equals to ch. So if this condition is true, it means ch is available in string. So I can increase value of c by 1. So whenever this if condition is true, then only c will be incremented by 1. So c is counting how many times ch is available inside str string. So after completion of this loop, the counted value of c will be returned to the main function and that value will be stored inside c variable which is returned in function calling statement at line number 13. And then printf will display the output on console. So this way I have implemented the complete code in front of you by passing string into function. Now I am going to execute this code. So I am entering my name Sanjay and I want to count frequency of a. So you can see total availability of a is 2. So a is available two times in my name. So the program is working properly. Again I am executing this code. This time I have entered Sanjay again. Now I want to count frequency of m. You can see total availability equals to 0. So the program is working properly. It is showing correct results. I hope you have understood how I have calculated the logic which is available in front of you. 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 Tagmiss which is available on Google Play. Thank you for watching this video.