C# DataType MCQs

Question 1: Which of the following data types can include maximum positive or negative, integer or float value?

Question 2: Which of the following data type will you use to store the monetary value?

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

public static void Main()
{
    float x = 30.423f;
    long y = 20L, 
    z = x+y;

    Console.WriteLine(z);
}

Question 4: Which of the following is a reference type?

Question 5: Which of the following is a value type?

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

public static void Main(string[] args)
 {
    float f = 10.5F;
    int i = 20;
    var sum = f + i;

    Console.Write(sum);
}

Question 7: You want to hold the largest positive integer value in a variable. Which of the following data type will you use for a variable?

Question 8: If you want to hold a positive integer value up to 250. Which of the following data type will you use for a variable?

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

Console.WriteLine(Convert.ToInt32('A'));

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

public static void Main(string[] args)
{
    int x = 5;
    square(x);
    Console.Write(x);
}

static void square(int x)
{
    x = x * x;
}