Ejercicio
Tabla de multiplicar
Objetivo
Escriba un programa en Visual Basic para pedir al usuario un número y mostrar su tabla de multiplicar, de la siguiente manera:
5 x 1 = 5
5 x 2 = 10
5 x 3 = 15
...
5 x 10 = 50
Código
' Import the System namespace to use Console class
Imports System
Public Class Program
' Main subroutine, entry point of the program
Public Shared Sub Main()
' Prompt the user to enter a number
Console.Write("Please enter a number: ")
Dim number As Integer = Convert.ToInt32(Console.ReadLine())
' Display the multiplication table for the entered number
Console.WriteLine("The multiplication table for " & number & " is:")
For i As Integer = 1 To 10
Dim result As Integer = number * i
Console.WriteLine(number & " x " & i & " = " & result)
Next
End Sub
End Class