Answer to Question #191195 in Visual Basic for Blessing

Question #191195

Write a simple visual basic program to find the average of five numbers


1
Expert's answer
2021-05-09T23:54:59-0400
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:



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS