This document describes a program that rounds numbers. The program first defines a number variable and assigns it a value of 10.6. It then uses the Math.Round function to round the number and outputs the result to the console. The program is then modified to prompt the user to enter a number, round that input, and display the rounded number back to the user.
2. Rounding Numbers
Module Module1
Sub Main()
Dim number As Double
number = 10.6
Console.WriteLine(Math.Round(number))
Console.ReadLine()
End Sub
End Module
3. Rounding Program
Module Module1
Sub Main()
Dim number As Double
number = 10.6
Console.WriteLine(ENTER THE NUMBER YOU WANT TO ROUND ")
number = Console.ReadLine()
Console.WriteLine(Math.Round(number))
Console.WriteLine(YOUR NUMBER ROUNDED IS " & number )
Console.ReadLine()
End Sub
End Module