14,733,306 members
See more:
how can I get the highest and lowest number when i enter 5 numbers and get the sum of it and after, the average of 5 numbers using vb.net..help me..Thank You!!
Posted
Updated 6-Aug-12 4:20am
v2
bbirajdar 6-Aug-12 9:18am

How are you going to learn if you get the homework done by somebody else ?

## Solution 1

you should use 'for loop' and 'math' functions to solve this.

Happy Coding!
:)
bbirajdar 6-Aug-12 9:19am

Correct solution for the homework question +5.. The OP needs guidance and not code...
Aarti Meswania 6-Aug-12 9:21am

thank you :)

## Solution 3

Dim iArray() As Integer = {10, 30, 50, 40, 20}

Dim iSum As Integer = 0

Dim iLowerNumber As Integer = iArray(0)

Dim iHeighest As Integer = iArray(0)

For index As Integer = 0 To iArray.Length - 1

iSum += iArray(index)

If iLowerNumber > iArray(index) Then
iLowerNumber = iArray(index)

End If

If iHeighest < iArray(index) Then
iHeighest = iArray(index)
End If

Next

Dim iAverage As Double = iSum / 5

Label1.Text = " Lowest Number ==" + iLowerNumber.ToString() + " Hiest Number == " + iHeighest.ToString() + " Sum of the Numbers == " + iSum.ToString() + " Average of the Numbers == " + iAverage.ToString()