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; }

Respuesta :

Answer:

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.

lbe254

Answer:

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.