Two negative numbers Learn programming Visual Basic (


Flow Control


Two negative numbers 68


Create a Visual Basic ( program to accept two numbers from the user and answer if both are negative or not.


Imports System
Public Class exercise26
    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")
        If Not ((number1 < 0) AndAlso (number2 < 0)) Then Console.WriteLine("the numbers are NOT negative")
    End Sub
End Class