Trying to read user input string from the key board and assign it to an Array. It still confusing.
Also any Idea what char ch = 97 is in this program? Thanks.
#include<stdlib.h>
int main()
{
int i = 0;
int j = 0;
int count[26]={0};
char ch = 97;
char string[100]="readmenow";
for (i = 0; i < 100; i++)
{
for(j=0;j<26;j++)
{
if (tolower(string[i]) == (ch+j))
{
count[j]++;
}
}
}
for(j=0;j<26;j++)
{
printf("\n%c -> %d",97+j,count[j]);
}
}