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.
For example:
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!".
Program to find occurrence of a character in an input string in C
Output
need an explanation for this answer? contact us directly to get an explanation for this answer