Hi guys, I need help with few things in this code.
1.It doesn't show how often symbol appear in array;
2.I'm not sure where to put the if function to check if its a lowercase letter and if its correct;
3.What to write in the printf to show what lowercase letter is most frequent.
Thanks.
Code:
#include <string.h>
#include <stdio.h>
int main()
{
int i=0, max=0, freq=0, j;
char array[]="AbcdFFaaAAchBaaamvxsdfGGbbb";
char temp_symbol;
for (i=0;i<=strlen(array);i++)
{array[i]=temp_symbol;
for (j=0;j<strlen(array);j++)
{
if(array[j]==temp_symbol)
{
freq++;
}
}
if (freq> max)
{max=freq;
freq=0;}
}
printf("most frequent lowercase letter is which repeats %d times", max );
return 0;
}
// if(str[i] >= 97 && str[i] <= 122)