Ejercicio
Multiplicar usando variables
Objetivo
Escriba un programa en Visual Basic para imprimir el resultado de multiplicar dos números que ingresará el usuario.
Código
' Main class definition
Public Class Program
' Main subroutine, entry point of the program
Public Shared Sub Main()
' Prompt the user to enter the first number
Console.Write("Enter the first number: ")
Dim number1 As Integer = Convert.ToInt32(Console.ReadLine())
' Prompt the user to enter the second number
Console.Write("Enter the second number: ")
Dim number2 As Integer = Convert.ToInt32(Console.ReadLine())
' Perform multiplication and store the result
Dim result As Integer = number1 * number2
' Display the result on the screen
Console.WriteLine("The result of multiplying the two numbers is: " & result)
End Sub
End Class