Multiple choice

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 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

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Here the no. readable are range 0 to 100 but the output of the program is interested in scores above 50 so there are 50 values (51 to 100) in this range. So only an array 50 integers required as we get any no. we increment the value stored at index.Array [x − 50] by