I'm trying to find the minimum value of numbers in an array but it doesn't always work out properly. This is the code I wrote:
for (int i=0; i < arr.length; i++ ) {
min = arr[i];
for (j=0; j < arr.length; j++) {
if (arr[j] < arr[0]) {
min = arr[j];
}
}
}
Can someone correct me please?