Please help me with my program. I need to create a program that asks the user for the filename, then counts the number of occurrence of each letter in that file.
Use a counter for each letter. For example, we want to check how many 'A' letter in a sentence? it is simple.
int A_counter // this variable stores how many 'A' letter in a sentence.
The idea is read the entered sentence, then check by using if statement, if if statement finds 'A' letter, our A_counter will increase ( A_counter++ ). In the end, print out A_counter.
yes that was my idea all along but i was thinking that there might be a simpler or shorter way without needing to declare all that acounter, bcounter, ccounter.... etc. Anyway, thanks for your answer man.