Multiply using variables Learn programming Visual Basic (VB.net)

Lesson:

First contact with Visual Basic (VB.net)


Exercise:

Multiply using variables 42


Objetive:

Write a Visual Basic (VB.net) program to print the result of multiplying two numbers which will entered by the user.


Code:

Imports System

Public Class exercise5
    Public Shared Sub Main()
        Dim number1 As Integer
        Dim number2 As Integer
        Dim multiplication As Integer
        System.Console.WriteLine("Enter 1st number")
        number1 = System.Convert.ToInt32(System.Console.ReadLine())
        System.Console.WriteLine("Enter 2nd number")
        number2 = System.Convert.ToInt32(System.Console.ReadLine())
        multiplication = number1 * number2
        System.Console.WriteLine("The multiplication is:")
        System.Console.WriteLine(multiplication)
    End Sub
End Class