K&R C Exercise 1-14: Histogram of Character Frequencies
Exercise 1-14. Write a program to print a histogram of the frequencies of different characters in its input. Approach The key insight here is one of the most elegant idioms in C: a character read from getchar() is already an integer — its ASCII value. That value falls in the range 0–127, so it can …