0
Can we use the built-in method 'min' to find the minimum from the numbers (let's say from 6 numbers of an array) in an array?
5 Antworten
+ 1
min function is used to find minimum of two operands
+ 1
but you can build your own method for array or n number of numbers to find the minimum, if you need i can write diwn here
+ 1
int[] example = {9, 7, 4,8,3,6,19,30};
int min = 10000000000000;
for(int number: example){
min = Math.min(min, number);
}
0
Thanks a lot! I would be very grateful!
0
output: 3