lenelex.com
Home
Quizzes
Games
Register
Log in
Question 1 of 15
What is the result of the following code fragment?
int? a = 8, b = null; Console.WriteLine($"{a >= b}, {a <= b}");
A. True, False
B. False, False
C. False, True
D. Null, Null
Comparing nullable types
When you perform comparisons with nullable types, if the value of one of the nullable types is null and the other is not, all comparisons evaluate to false except for != (not equal). It is important not to assume that because a particular comparison returns false, the opposite case returns true.
Links:
int
Nullable Types
Using Nullable Types