hi friend
i need to find the maximum of negative value
for example
if -11,-2,-345,-98,-88 then
i need the value of -11
can anyone help me
How to get maximum of negative value in vb.net
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Kirtan PatelRank #292 · 8.6K reputationPosted Mar 1, 2010, 12:29 AM EST
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Array() As Integer = {-11, -2, -345, -98, -88}
Dim max As Integer
max = Array(0)
For Each i As Integer In Array
If i > max Then
max = i
End If
Next
MsgBox("Max is :" & max)
End Sub