Ask 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]]);

+3
Answers (1)
  1. 26 May, 07:43
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers