X1085: Change Even Indices

The following method takes in a 1-dimensional array of integers and should change every item that has an even index to the number 100. Every number at an odd index should be set to 0.

For example, if we had an array like this...

  int[] arr = new int[4];

Running changeEvenIndices(arr) should return the array {100, 0, 100, 0}

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.