Character Histogram

For every possible character on stdin, count the number of occurrences of that character. At program termination (end of file, EOF), print a histogram as in the example below.

  • Printable characters are output as-is

  • Nonprintable characters are output as their ASCII values.

Note

The decision whether a character is printable is made using the isprint() library function. See manual page.

0  ... |
1  ... |
.
'a'... |xxxxxxxxxxxxxxxxxxxxxxxxx
'b'... |xxxxxxxxxxxxxxxxxx
.
.