public class ArrayMin {
public static void main(String[] args) {
int i; // array index
double min; // Current min value
double[] a = { 2.3, 3.4 , 4.5, 5.6, 1.2, 7.8, 8.9 }; // 7 elements
double[] b = { -8.8, 9.7, -14.6, 89.8 }; // 4 elements
min = a[0]; // Initial min. value
for ( i = 1 ; i < a.length ; i++ )
{
if ( a[i] < min )
{
min = a[i]; // Found a smaller min. value
}
}
System.out.println(min);
}
}