Which C# pattern matches a value that is an int greater than 100, as in x is > 100?
Correct answer B. A relational pattern
Explanation
Relational patterns, added in C# 9, compare a value against a constant using <, or >=. They can be combined with the logical patterns and, or and not, as in x is >= 1 and <= 9. A discard pattern _ matches anything, a var pattern captures any value, and a list pattern matches sequences such as [1, 2, ..].
Answer checked How we write and check questions
Discussion