write a java code that print the largest number of an array,
1
Expert's answer
2021-01-15T09:26:59-0500
publicvoidfindMax(int[] arr){
int max = Integer.MIN_VALUE;
for (int i = 0; i < arr.length; i++) {
max = Math.max(max, arr[i]);
}
System.out.println("The max number is: " + max);
}
Comments