Complete the code to get the type of the variable number.
int number = 5; Type typeInfo = number.[1];
In C#, GetType() is a method that returns the runtime type of an object.
Complete the code to print the name of the type of text.
string text = "hello"; Console.WriteLine(text.[1].Name);
GetType() returns a Type object, and Name gives the type's name as a string.
Fix the error in the code to get the type of obj and print its full name.
object obj = 10; Type t = [1]; Console.WriteLine(t.FullName);
Type().To get the runtime type of an object, call GetType() on the instance.
Fill both blanks to create a dictionary with words as keys and their lengths as values, but only include words longer than 3 characters.
var words = new List<string> { "cat", "house", "tree", "a" };
var lengths = words.ToDictionary(word => word, word => word.[1])
.Where(kv => kv.Value [2] 3)
.ToDictionary(kv => kv.Key, kv => kv.Value);Length gets the length of a string, and filtering with > 3 keeps only longer words.
Fill all three blanks to create a dictionary with uppercase keys and values only for entries where the value is greater than 10.
var data = new Dictionary<string, int> { {"a", 5}, {"b", 15}, {"c", 20} };
var result = data.Where(kv => kv.Value [1] 10)
.ToDictionary(kv => kv.Key.[2](), kv => kv.[3]);Filter values greater than 10, convert keys to uppercase with ToUpper(), and use Value for dictionary values.