-
A program P reads in 500 integers in the range [0, 100] representing the scores of 500 students. It then prints the frequency of each score above 50. What would be the best way for P to store the frequencies ?
-
- An array of 50 numbers
- An array of 100 numbers
- An array of 500 numbers
- A dynamically allocated array of 550 numbers
- An array of 50 numbers
Correct Option: A
We have to store frequencies of scores above 50. That is number of students having score 51, number of students having score 52 and so on. For that an array of size 50 is the best option.