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

Search this Site

19 Jun 2013

VB.NET PROGRAM TO ADD TWO NUMBERS / INTEGERS

VB.NET PROGRAM TO ADD TWO NUMBERS / INTEGERS


Module Module1

    Sub Main()
        Dim x, y, result As Integer

        Console.WriteLine(">>> VB>NET Console program to add two integers <<<")
        Console.Write(" Enter the first number to be added: ")
        x = Convert.ToInt32(Console.ReadLine())
        Console.Write(" Enter the second number to be added: ")
        y = Convert.ToInt32(Console.ReadLine())
        result = x + y
        Console.Write(Environment.NewLine & " The sum of two numbers is:" & result)
        Console.ReadLine()

    End Sub

End Module

Sample Output :

No comments:

Post a Comment

Thanks for your comments.
-Sameer