We'll say variables a, b, and c have the values of 1, 2, and 3 respectively. Does anyone have an easier solution for finding which variable has the highest value than using IF's and ">"? That may seem like the easiest solution in this application, but when more than 3 variables start coming into play the lines of IF statements can get pretty long
Finding the highest variable
-
NPG92 -
June 19, 2018 at 5:30 AM -
Thread is Resolved
-
-
This is a general programming question...
If you have a lage number of comparison to do, declare your variables as an array of REAL or INT and then use a FOR loop to iterate...
diglo
-
This is a general programming question...If you have a lage number of comparison to do, declare your variables as an array of REAL or INT and then use a FOR loop to iterate...
diglo
Yes, I'm decent when it comes to creating mathematical formulas, but this one either slips past me or is too complex for me to think of off the top of my head. Could you please elaborate on the array idea?
-
array is a collection of elements that share same data type and same name. elements are distinguished by index. this makes it possible to refer to any element by simply changing index value rather than typing element name. in other words things like searching, sorting etc becomes practical.