LO: (Apply) Students will use vectors to store data for a computation.
The mode of a dataset is the item that appears most frequently.
Write a program to read in numbers between 1 and 100 and then report the mode. If more than one number appears most frequently, choose the highest number. Output a line with the result in this format:
The most frequent value was 42, appearing 9 times.
For example: If you input 4 5 6 -2 2 70 -10 output is The most frequent value was 6, appearing 1 times.2 or if you Input 5 2 9 2 60 12 60 2 1054 output The most frequent value was 2, appearing 3 times.
Comments
Leave a comment