You are viewing a single comment's thread. Return to all comments →
This code is not working... I'm doing it in java static void miniMaxSum(int[] a) { int max=0,min=1000000001,sum=0; for(int i=0 ; i<5 ; i++){
if(a[i]>max){ max = a[i]; } if(a[i]<min){ min=a[i]; } sum=sum+a[i]; } System.out.print((sum-max) + " " + (sum-min)); }
Seems like cookies are disabled on this browser, please enable them to open this website
Mini-Max Sum
You are viewing a single comment's thread. Return to all comments →
This code is not working... I'm doing it in java static void miniMaxSum(int[] a) { int max=0,min=1000000001,sum=0; for(int i=0 ; i<5 ; i++){