Complete the code to check if variable a is greater than b.
bool result = a [1] b;== instead of > to compare values.< which means less than.The > operator checks if the left value is greater than the right value.
Complete the code to check if score is less than or equal to 100.
if (score [1] 100) { Console.WriteLine("Valid score"); }
< which excludes equality.>= which means greater than or equal.The operator <= means 'less than or equal to'.
Fix the error in the comparison to check if age is not equal to 18.
if (age [1] 18) { Console.WriteLine("Age is not 18"); }
= which is assignment, not comparison.<> which is not valid in C#.The operator != means 'not equal to' in C#.
Fill both blanks to create a dictionary that maps numbers to their squares only if the number is greater than 3.
var squares = new Dictionary<int, int> {
{ [1], [2] }
};The key is 4 (greater than 3) and the value is its square 16.
Fill all three blanks to create a LINQ query that selects numbers from 1 to 5 where the number is less than 4 and doubles them.
var result = from num in Enumerable.Range(1, 5) where num [1] 4 select num [2] [3];
The query filters numbers less than 4 and selects their doubles by multiplying by 2.
