VB.Net Tutorial/Operator/Relational Operators

Материал из VB Эксперт
Перейти к: навигация, поиск

Using equality and relational operators.

Module Tester
   Sub Main()
      Dim number1, number2 As Integer
      number1 = 10
      number2 = 20
      If number1 = number2 Then
         Console.WriteLine("{0} = {1}", number1, number2)
      End If
      If number1 <> number2 Then
         Console.WriteLine("{0} <> {1}", number1, number2)
      End If
      If number1 < number2 Then
         Console.WriteLine("{0} < {1}", number1, number2)
      End If
      If number1 > number2 Then
         Console.WriteLine("{0} > {1}", number1, number2)
      End If
      If number1 <= number2 Then
         Console.WriteLine("{0} <= {1}", number1, number2)
      End If
      If number1 >= number2 Then
         Console.WriteLine("{0} >= {1}", number1, number2)
      End If
   End Sub 
End Module
10 <> 20
10 < 20
10 <= 20