Module Module1

    Sub Main()
        Dim x, y As Integer
        Dim result As Integer
        Console.WriteLine("*** www.ProgrammingPosts.blogspot.com ***")
        Console.WriteLine(">>> VB.NET PROGRAM FOR PRODUCT OF TWO NUMBERS <<< ")
        'vblf gets the cursor to next line in console
        Console.Write(vbLf & " Enter the first number : ")
        ' reading 1st number from user
        x = Convert.ToInt32(Console.ReadLine()) 'converting input to type int

        Console.Write(vbLf & " Enter the second number: ")
        ' reading 2nd number from user
        y = Convert.ToInt32(Console.ReadLine()) 'converting input to type int

        ' storing the product in result
        result = x * y
        'printing the result
        Console.WriteLine(vbLf & " The product of two numbers is: {0} ", result)
        Console.ReadLine()
    End Sub

End Module

 

Sample Output:
VB.Net Product Two Numbers

Leave a Reply

Your email address will not be published.