FindExtremes

From ggc

Jump to: navigation, search

01 /**
02  * All about my application here.
03  @author Jam Jenkins
04  */
05 public class FindExtremes
06 {
07   public static void main(String[] args)
08   {
09     int[] nums={36526714523, -26};
10 
11     int min=nums[0];
12     System.out.println("Starting minimum: "+min);
13     for(int i=1; i<nums.length; i++)
14     {
15       System.out.println("Looking at: "+nums[i]);
16       if(nums[i]<min)
17       {
18         System.out.println("Exceeded extreme.");
19         min=nums[i];
20       }
21       System.out.println("Minimum is now "+min);
22     }
23     System.out.println("Finally, the minimum is "+min);
24   }
25 }


Download/View FindExtremes.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter