public class minFinder {
public static void main(String[] args) {
float[] array = {-1,-2,-3,-4,-5,-6,-7,-8,-9,-10,10,9,8,7,6,5,4,3,2,1};
float minVal = array[0];
for (int i = 1; i < array.length; i++) {
if(array[i] < minVal & array[i] < 0) minVal = array[i];
}
System.out.println(minVal < 0?"Min in array is " + minVal:"Min in array has not found");
}
}
int x = 0;
while(x != 5) {
System.out.println("post " + x++);
}
int x = 0;
while(x != 5) {
System.out.println("pre " + ++x);
}
post 0
post 1
post 2
post 3
post 4
pre 1
pre 2
pre 3
pre 4
pre 5