Ejercicio
Dividir si no es cero (Usar else)
Objetivo
Crear una versión del programa anterior, usando "else"
Código
' Import the System namespace to use Console classImports System
Public Class exercise18
Public Shared Sub Main()
Dim number1, number2 As Integer
Console.Write("Enter the first number:")
number1 = Convert.ToInt32(Console.ReadLine())
Console.Write("Enter the second number:")
number2 = Convert.ToInt32(Console.ReadLine())
If number2 <> 0 Then
Console.WriteLine("The result for {0} / {1} is {2}", number1, number2, number1 / number2)
Else
Console.WriteLine("No result")
End If
End Sub
End Class