/* write a program that reads a sequence of chars, EOF (end of file) terminates the input in C, to enter EOF from keyboard you will use a combo of the following chars: ENTER-ctrl-D ENTER will count toward the input. If you don't want it you can subtract 1 from count_others the program counts the number of 'a'/'A', the number of 'b'/'B' and the number of 'c'/'C' and the program counts the number of other chars that are not listed above use switch */ #include int main(){ char ch; int countA=0, countB=0, countC=0, count_others=0; while((ch=getchar())!=EOF){ switch(ch){ case 'a': case 'A': countA++; break; case 'b': case 'B': countB++; break; case 'c': case 'C': countC++; break; default: count_others++; break; } } printf("countA=%d, countB=%d,countC=%d,count_others=%d\n",countA,countB, countC, count_others); return 0; }