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
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Mar 1, 2010, 5:29 AM
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