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

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("*** 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:


No comments:

Post a Comment

Thanks for your comments.
-Sameer