I am comparing the max and min of 6 variables which i calculated separately and then i would do a switch. The problem is, when i am doing max comparison using Math.Max(var1, var2, var3, var4, var5, var6), i am getting the below error.
“Overload resolution failed because no accessible ‘Max’ accepts this number of arguments”
Can someone help please. Started learning recently.
Array of Integers will be your best choice here, create a variable of Integer[] type and Assign it to something like this: MyArray=new Integer(5) { var0, var1, var2, var3, var4, var 5}
Then min will be and max will be like: varMin=MyArray.Min() varMax=MyArray.Max()