Complete the code to assign the default value of an int variable.
int number = [1];In C#, default(int) returns the default value for the int type, which is 0.
Complete the code to assign the default value of a bool variable.
bool isActive = [1];default(bool) returns false, the default value for bool.
Fix the error in the code to assign the default value of a string variable.
string name = [1];Using default(string) assigns null which is the default for reference types like string.
Fill both blanks to create a method that returns the default value of a generic type T.
public T GetDefaultValue<[1]>() { return [2]; }
The generic type parameter is T, and default(T) returns its default value.
Fill all three blanks to create a dictionary with keys as strings and values as default values of type int.
var defaults = new Dictionary<string, int> {
{"one", [1],
{"two", [2],
{"three", [3]
};Using default(int) assigns the default int value 0 to each dictionary entry.