Complete the code to declare a value type variable.
int number = [1];The variable number is a value type and can be assigned a direct integer value like 10.
Complete the code to declare a reference type variable.
string text = [1];The variable text is a reference type and can be assigned a string literal with quotes.
Fix the error in copying value types.
int a = 5; int b = [1]; // b should have the same value as a
Assigning b = a copies the value of a into b. Value types copy the data directly.
Fill both blanks to copy reference types correctly.
class Person { public string Name; } Person p1 = new Person(); p1.Name = "Alice"; Person p2 = [1]; p2.Name = "Bob"; Console.WriteLine(p1.Name); // Outputs [2]
Assigning p2 = p1 copies the reference, so both point to the same object. Changing p2.Name changes p1.Name too.
Fill all three blanks to create a dictionary with value types and filter by condition.
var scores = new Dictionary<string, int> {
{"Alice", 90},
{"Bob", 75},
{"Charlie", 85}
};
var highScores = scores.Where(kv => kv.Value [1] [2]).ToDictionary(kv => kv.Key, kv => kv.Value);
Console.WriteLine(highScores[[3]]); // Outputs 90This code filters the dictionary to include only scores greater than 80, then prints Alice's score which is 90.