212k views
2 votes
Given the following declaration, where is the value 77 stored in the scores array?

int scores[] = {83, 62, 77, 97};

A) scores[0]
B) scores[1]
C) scores[2]
D) scores[4]

1 Answer

6 votes

Final answer:

The value 77 is stored at scores[2] in the array. Arrays start with an index of 0, making scores[2] the third element.

Step-by-step explanation:

The value 77 is stored at scores[2] in the scores array. Arrays in programming usually start with an index of 0. Hence, 83 is at scores[0], 62 is at scores[1], and 77 is at scores[2]. The option that correctly identifies where the value 77 is stored is C) scores[2].

User Paul Bellora
by
7.9k points

No related questions found