Complete the code to check if the number is greater than 10 using a relational pattern.
if (number is > [1]) { Console.WriteLine("Number is greater than 10"); }
The relational pattern is > 10 checks if number is greater than 10.
Complete the code to check if the age is less than or equal to 18 using a relational pattern.
if (age is [1] 18) { Console.WriteLine("Minor age"); }
The pattern is <= 18 checks if age is less than or equal to 18.
Fix the error in the relational pattern to check if temperature is not equal to 0.
if (temperature is not [1]) { Console.WriteLine("Temperature is not zero"); }
The correct pattern to check 'not equal' is is not 0.
Fill both blanks to check if score is between 50 and 100 inclusive using relational patterns.
if (score is >= [1] and <= [2]) { Console.WriteLine("Score is in the passing range"); }
The pattern checks if score is greater than or equal to 50 and less than or equal to 100.
Fill all three blanks to create a pattern that checks if value is greater than 0, less than 10, and not equal to 5.
if (value is > [1] and < [2] and not [3]) { Console.WriteLine("Value is valid"); }
The pattern checks if value is greater than 0, less than 10, and not equal to 5 using relational patterns.