Parameters of Main, Sum Learn programming Visual Basic (VB.net)

Lesson:

Functions


Exercise:

Parameters of Main, Sum 13


Objetive:

Create a program named "sum", which receives two integer numbers in the command line and displays their sum, as in this example:

sum 5 3
8


Code:

Imports System
Public Class exercise112
    Public Shared Sub Main(ByVal args As String())
        If args.Length = 2 Then
            Console.WriteLine(Convert.ToInt32(args(0)) + Convert.ToInt32(args(1)))
        Else
            Console.WriteLine("Two numbers, please")
        End If
    End Sub
End Class