Chapter 8, exercise 2 answer

From CompSciWiki
Jump to: navigation, search
int lowPos;
int lowest = INTEGER.MAX_VALUE;    //set to the highest possible value so everything is smaller
int array[] = new int[100];

//have values entered into the array

//go through the array
for(int i=0; i<array.length; i++) {
   if(array[i] < lowest) {
      lowest = array[i];
      lowPos = i;
   }
}