I have 6 varibles that need to be compared and I need the ones with the highest value to do somethings, how do I just find the 2 with the highest value or compared the 6 and find the highest and second highest???
//Pass 1 get the highest... set high = a if(b > high) high = b if(c > high) high = c if(d > high) high = d if(e > high) high = e if(f > high) high = f
//Pass 2 check to see if there are 2 equal high values count=0; if(a == high)count++ if(b == high)count++ if(c == high)count++ if(d == high)count++ if(e == high)count++ if(f == high)count++ if(count > 1) high2 = high else if(a != high) high2 = a if(b != high and b > high2) high2 = b if(c != high and c > high2) high2 = c if(d != high and d > high2) high2 = d if(e != high and e > high2) high2 = e if(f != high and f > high2) high2 = f
first = num[0];
second = num[0];
for (int i = 1; i <= max; i++)
{
if num[i] > first
{
second = first;
first = num[i];
}
elseif num[i] > second
{
second = num[i];
}
}