👤

Which of the following code snippets will load an array named fives(), consisting of 10 elements with the starting value of the first element = 0 and will load each subsequent element counting by 5's, ending with the last element = 45. In other words, the elements in the fives() array should be (0, 5, 10, 15, ... 45).
A. var fives = new Array();
for(j = 1; j < 11; j++)
fives[j] = j + 5;
B. var fives = new Array();
for(j = 1; j < 11; j++)
fives[j] = j * 5;
C. var fives = new Array();
fives[0] = 0;
for(j = 1; j < 10; j++)
fives[j] = fives[j - 1] + 5;
D. var fives = new Array();
for(j = 0; j < 11; j++)
fives[j] = fives[j ] + 1

Answer :

C: var fives = new Array(); fives[0] = 0; for(j = 1; j < 10; j++) fives[j] = fives[j - 1] + 5; is the correct answer option.

An array is a collection of similar data items stored at contiguous memory places. The array is the simplest data structure where each data element can be accessed directly by using its index number.  In regard to the given question, in option c the required code is given that will load an array of fives(), with the starting value of the first element = 0, and will load each subsequent element by addition of 5, ending with the last element = 45.

You can learn more about array at

https://brainly.com/question/28565733

#SPJ4