hey guys, need some help with this project i have made.
Static temp(7) As Integer
Dim total As Integer
Dim I As Integer
Dim average As Single
'Initialize
Randomize()
'Temperature Generator
For I = 1 To 7
temp(I) = Int(Rnd(1) * 38 + 1)
Next I
For I = 1 To 7
Debug.WriteLine(temp(I))
Next I
Debug.WriteLine("****************")
'get average
total = 0
For I = 1 To 7
total = temp(I) + total
Next I
'output
average = (total / 7)
Debug.WriteLine(average)
That code makes a program that random generates 7 numbers and makes an average of them in the immediate window( is working ). How would i be able to get the minimum(lowest) and maximum(highest) number from the 7 numbers and output the two numbers to preferably a textbox or immediate window.
If anyone could help would be great, thankyou