Frequency of a Character

Gapfill exercise

  

#include <stdio.h>
int main()
{
char str[1000],
int ;

printf("Enter a string: ");
fgets(str, sizeof(str), stdin);

printf("Enter a character to find its frequency: ");
scanf("%c", &ch);

for (int i = 0; str[i] != '\0'; ++i)
{
if
++count;
}

printf("Frequency of %c = %d", ch, count);
return 0;
}

1.GIF