Question: 5. (10 points) Write a program that reads inteers in the range [0, n] from standard input, and then prints a frequency table of how

5. (10 points) Write a program that reads inteers in the range [0, n] from standard input, and then prints a frequency table of how many of each integer were entered. (You can assume n is a global constant in your program, but do not assume any particular value for it.) If the program encounters any integers not in the range, or any input that is not an integer, the behavior can be left undefined (it could just stop reading data and print the results it has so far, crash, or whatever). Here is an example: if the program name is ftable, and if n 7 then executing $ echo 0 07 3 1 3 3761 /ftable would produce output like this: 0: 2 2: 0 3: 3 4: 0 5: 0 7: 2 You can assume that all the standard #includes are there. Just write the main() function. (Hint: use an array or a vector.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
