Home » Programming & Data Structure » Programming and data structure miscellaneous » Question

Programming and data structure miscellaneous

Programming & Data Structure

  1. 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 ?
    1. An array of 50 numbers
    2. An array of 100 numbers
    3. An array of 500 numbers
    4. A dynamically allocated array of 550 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.



Your comments will be displayed only after manual approval.