Find second strongest value from array

To add comments, please log in or register
Sinisa Zizic
Sinisa Zizic  

     How to find second max/min value from array?  (first down from strongest valute)

     This is my code for max/min values:

           int num_array1[8];


          int strongvalute=ArrayMaximum(num_array1,WHOLE_ARRAY,0);

          int weakvalute=ArrayMinimum(num_array1,WHOLE_ARRAY,0);


      I need:

      int second_strongvalute?

      int second_weakevalute?

Bartlomiej Gorski
Bartlomiej Gorski  
Find max as you did in your example, make a loop on your array, compare values to find largest one, skip index that was found as max.
paul selvan
paul selvan  
 ArraySort() will help you to find them 
nicholi shen
nicholi shen  
   int arr[] = {1, 2, 3, 4, 5};
   ArraySort(arr, WHOLE_ARRAY, 0, MODE_DESCEND);
   Print("second highest ", arr[1]);
To add comments, please log in or register