Write a simple visual basic program to find the average of five numbers
Module Module1
Sub Main()
Threading.Thread.CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("en-us")
Dim sum As Double = 0
For i As Integer = 0 To 4
Console.Write("Enter a number {0}: ", (i + 1))
sum += Double.Parse(Console.ReadLine())
Next
Dim average As Double = sum / 5.0
Console.WriteLine("The average of five numbers: {0}", average)
Console.ReadLine()
End Sub
End Module
Example:
Comments
Leave a comment