Ask Question
28 February, 15:30

Fill in each blank with the correct answer/output.

int[] vals = {7,5,3,9,0,37,93,16,68,6,99};

System. out. println (vals[vals[1]+vals[4]]);

+5
Answers (1)
  1. 28 February, 18:34
    0
    37

    Explanation:

    Given int[] vals = {7,5,3,9,0,37,93,16,68,6,99};

    In programming, the position of each value in the list are known as index. The first value is always assigned index of 0 not 1, the second value is assigned index of 1 and so on. For example;

    val[0] = 7 i. e value with index 0

    val[1] = 5

    val[4] = 0

    In order to print out this value

    System. out. println (vals[vals[1]+vals[4]]);

    Substituting the index value val[1] and val[4] into the argument given

    vals[vals[1]+vals[4]]

    = vals[5+0]

    = vals[5]

    = 37 (value at the 5th index)

    System. out. println (vals[vals[1]+vals[4]]);

    = 37

    This means that the system will print out 37 to the console
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Fill in each blank with the correct answer/output. int[] vals = {7,5,3,9,0,37,93,16,68,6,99}; System. out. println (vals[vals[1]+vals[4]]); ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers