Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

MinimumAndMaximum

 public static void main(String[] args) {

        int[] arr = {10,20,30,90,50};
        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        
        for(int x : arr){
          if(x < min) min = x;
        }

         for(int x : arr){
           if(x > max) max = x; 
        }
Source by aprove.informatik.rwth-aachen.de #
 
PREVIOUS NEXT
Tagged: #MinimumAndMaximum
ADD COMMENT
Topic
Name
4+3 =