Ask Question
7 February, 20:26

Assume the array of integers values has been created. Which condition must be used in the indicated area so the loop below will assign max the largest value in values? int max = values[0]; for (int val: values) { if ( / * Put condition here * / ) max = val; }

+4
Answers (1)
  1. 7 February, 22:10
    0
    val > max

    Explanation:

    Assuming the values array is already created, inside the loop, we need to check if the val, a value in the values array, is greater than max. If it is greater than the max, that means it is our new max. Then we would set the max as the val. This way, if there is any value greater than max, it will be our max at the end of the loop.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Assume the array of integers values has been created. Which condition must be used in the indicated area so the loop below will assign max ...” 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