Generation

generate functionSat, 12 Nov 2022

Find max integer in list

int[] numbers = new int[]{9, 2, 15, 2, 22, 10, 6}; int max = numbers[0]; for(int i = 1; i < numbers.length; i++){ if (max < numbers[i]) { max = numbers[i]; } } System.out.println(max);

Questions about programming?Chat with your personal AI assistant