Code:#include <stdio.h> #include <ctype.h> #include <assert.h> //Frequency table of input int main(int argc, char*argv[]) { int counts[26] = {0}; int cypherChar = getchar(); while(cypherChar != EOF) { if(isalpha(cypherChar)) { counts[tolower(cypherChar) - 97]++; } cypherChar = getchar(); } printf("Frequency Table\n"); int i = 'a'; while(i <= 'z') { printf("%c %d\n", i, counts[i - 'a']); i++; } return 0; }
When I replace EOF with 10(ASCII value for Line Feed) it works fine but with EOF , NO OUTPUT!!