C# DataType MCQs

Question 31: What will the output of the following program?

public static void Main(string[] args)
{
	object o1 = "csharp";  
    char[] arr = {'c','s','h','a','r','p'};  
    object o2 = new string(arr);   

	Console.Write(o1 == o2);
	Console.Write(o1.Equals(o2));
}

Question 32: What will be the output of the following code?

int? x = null;
int y = x ?? -1;

Console.Write(y);

Question 33: What will be the output of the following program?

object obj = "hello";
Type t1 = typeof(obj); 
Type t2 = obj.GetType();  

Console.Write(t1 == t2);

Question 34: What will be the output of the following program?

static void Main(string[] args)
{
    object obj = "hello";
    Type t1 = typeof(object); 
    Type t2 = obj.GetType();  

    Console.Write(t1 == t2);
}

Question 35: What will be the output of the following program?

int i = null;
Console.WriteLine(i);