I have an array of numbers created by the user, the array is sorted and I can find the Average, Median, Max, Min, Lowest -> Highest, Highest -> Lowest. Now I just need to find the mode. Here is the code I made that works if there is only 1 Mode, I need to make it work to find 3 modes .. I.e. if the array was [1,1,1,2,2,2,3,3,3,5,6] then the mode would be 1 , 2 , 3
Dim countermode As Integer
Dim w, s, r, i, p, tempmode As Integer
p = 1
Sort(marks)
For w = (x - 1) To 0 Step -1
p += 1
For s = (x - p) To 0 Step -1
r = marks(w)
i = marks(s)
If i = r Then
countermode += 1
tempmode = marks(w)
End If
Next
Next
lblmode.Text = tempmode
