Imports System
Public Class exercise43
Public Shared Sub Main()
Dim num As Integer
Dim total As Integer = 0, amount As Integer = 0
Dim maximum, minimum As Integer
Console.Write("number? ")
num = Convert.ToInt32(Console.ReadLine())
maximum = num
minimum = num
While num <> 0
amount += 1
total += num
If num > maximum Then maximum = num
If num < minimum Then minimum = num
Console.WriteLine("Total={0} Amount={1} Average={2} maximum={3} minimum={4}", total, amount, total / amount, maximum, minimum)
Console.Write("number? ")
num = Convert.ToInt32(Console.ReadLine())
End While
Console.WriteLine("Bye!")
End Sub
End Class