Complete the code to add two numbers and print the result.
int a = 5; int b = 3; int sum = a [1] b; Console.WriteLine(sum);
The plus operator + adds two numbers together.
Complete the code to check if a number is greater than 10.
int number = 15; if (number [1] 10) { Console.WriteLine("Greater than 10"); }
The greater than operator > checks if the left value is bigger than the right.
Fix the error in the code to multiply two numbers.
int x = 4; int y = 6; int product = x [1] y; Console.WriteLine(product);
The multiplication operator * multiplies two numbers.
Fill both blanks to create a dictionary with word lengths for words longer than 3 letters.
var words = new List<string> { "apple", "cat", "banana", "dog" };
var lengths = words.Where(word => word.Length [1] 3)
.ToDictionary(word => word, word => word.Length [2] 1);The first blank uses > to filter words longer than 3 letters.
The second blank uses - to subtract 1 from the length.
Fill all three blanks to create a dictionary with uppercase keys and their lengths for words with length greater than 4.
var words = new List<string> { "tree", "house", "car", "elephant" };
var result = words.Where(w => w.Length [1] 4)
.ToDictionary(w => w.[2](), w => w.Length [3] 0);The first blank uses > to filter words longer than 4 letters.
The second blank uses ToUpper to make keys uppercase.
The third blank uses + to add 0 to the length (keeps length unchanged).