Ask Question
19 June, 17:53

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. 19 June, 18:34
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers