December 2001
Beginner
976 pages
22h 4m
English
Another class of operators commonly used in programming is the comparison operators, also known as relational operators in mathematics. These operators compare two values and return a Boolean value (True or False) depending on the result of the comparison. For example:
Dim i As Integer = 3, b As Boolean b = i < 5
The expression i < 5 on the right side of the assignment operator = is a relational expression, and < is the comparison operator known as “less than.” It has the same meaning as its mathematical counterpart. The expression will be evaluated to True since i is 3 and therefore, is less than 5. The result of this evaluation (the Boolean value True) will then be assigned to the variable b. The Table 7.2 lists the comparison ...
Read now
Unlock full access