This website completely moved to new platform. For latest content, visit

Search this Site

18 Aug 2013

VB.Net Program to get Product of two Numbers

Module Module1

    Sub Main()
        Dim x, y As Integer
        Dim result As Integer
        Console.WriteLine("*** ***")
        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)
    End Sub

End Module

Sample Output: