C program to find the frequency of a character in a string
In this program, we will learn how to find occurrence of a particular character in a string using C program?
Here, we are reading a character array/string (character array is declaring with the maximum number of character using a Macro MAX that means maximum number of characters in a string should not more than MAX (100), then we are reading a character to find the occurrence and counting the characters which are equal to input character.
If input string is "Hello world!" and we want to find occurrence of 'l' in the string, output will be 'l' found 3 times in "Hello world!".