Complete the code to declare a strongly typed integer variable in C#.
int number = [1];In C#, int variables must be assigned integer values like 10. Assigning a string or other types causes errors.
Complete the code to declare a strongly typed string variable in C#.
string greeting = [1];Strings in C# must be enclosed in double quotes. So "Hello" is correct.
Fix the error in the code by choosing the correct type for the variable.
var isActive = [1];The variable isActive should be a boolean. The value true without quotes is the correct boolean literal.
Fill both blanks to create a strongly typed list of integers and add a number to it.
List<int> numbers = new [1](); numbers.[2](5);
ArrayList which is not strongly typed.AddRange which expects a collection, not a single item.We create a new List<int> and use the Add method to add a single integer.
Fill all three blanks to declare a strongly typed dictionary and add a key-value pair.
Dictionary<[1], [2]> capitals = new Dictionary<[3], string>(); capitals.Add("France", "Paris");
int or bool for keys or values incorrectly.The dictionary uses string as the key type and string as the value type. So both key and value types are string.