Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- char ch[50], find;
- int count = 0;
- printf("Enter a string: ");
- gets(ch);
- printf("Enter a character for finding frequency: ");
- scanf("%c", &find);
- for (int i = 0; ch[i] != '\0'; ++i) {
- if (find == ch[i])
- count++;
- }
- printf("Frequency of %c = %d", find, count);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement