One or two negative numbers Learn programming Visual Basic (


Flow Control


One or two negative numbers 60


Create a Visual Basic ( program to accept two numbers from the user and answer if both are negative, if only one is, or if none of them is.


Imports System
Public Class Exercise27
    Public Shared Sub Main()
        Dim number1 As Integer
        Dim number2 As Integer
        Console.Write("number 1: ")
        number1 = Convert.ToInt32(Console.ReadLine())
        Console.Write("number 2: ")
        number2 = Convert.ToInt32(Console.ReadLine())

        If (number1 < 0) AndAlso (number2 < 0) Then
            Console.WriteLine("the numbers are negative")
        ElseIf (number1 < 0) OrElse (number2 < 0) Then
            Console.WriteLine("one is negative")
            Console.WriteLine("none is negative")
        End If
    End Sub
End Class