Array.java aktualisiert

Maximus und Minimum eines Arrays ausgeben
master
Jessica Luisa Wiedl 2023-10-23 10:56:29 +02:00
parent 6c99081073
commit d028638080
1 changed files with 16 additions and 1 deletions

View File

@ -32,7 +32,22 @@ public class Array
{
System.out.print(min = arr[i]);
}
//?
/**
max = items[0];
min = items[0];
for (int i = 1; i < items.length; i++) {
if (items[i] > max) {
max = items[i];
}
else if (items[i] < min) {
min = items[i];
}
}
System.out.println(max); //100
System.out.println(min); //0
**/
}
}
}