Delete comment from: Java67
satish said...
int a[]= {10,3,0,1,45,22,667,8,99,0,3};
int min = a[0];
int max = a[1];
int minPos = 0;
int maxPos = 1;
if(maxa[i]) {
min = a[i];
minPos = i;
}
if(max<a[i]) {
max = a[i];
maxPos = i;
}
}
System.out.println("min : "+ min +" Pos : "+(minPos+1));
System.out.println("max : "+ max +" Pos : "+(maxPos+1));
Apr 2, 2018, 1:20:30 PM
Posted to How to find largest and smallest number from integer array - Java Solution