1.
Choose effective differences between 'Boxing' and 'Unboxing'.

3.
What will be the output of the following C# code?
public static void Main(string[] args)
{
    int i = 123;
    object o = i;
    i = 456;
    System. Console. WriteLine("The value-type value = {0}", i);
    System. Console. WriteLine("The object-type value = {0}", o);
    Console. ReadLine();
}

4.
What will be the output of the following C# code?
class Program
{
    static void Main(string[] args)
    {
        int  i ;
        for (i = 0; i < 5; i++)
        {
            Console.WriteLine(i);
        }
        Console.ReadLine();
    }
}

7.
What will be Correct Set of C# Code for given data 'a' and 'b' to print output for 'c' as 74?

int a = 12;
float b = 6.2f;
int c;
c = a / b + a * b;
Console.WriteLine(c);

int a = 12;
float b = 6.2f;
int c;
c = a / convert.ToInt32(b) + a * b;
Console.WriteLine(c);

int a = 12;
float b = 6.2f;
int c;
c = a / convert.ToInt32(b) + a * convert.ToInt32(b);
Console.WriteLine(c);

int a = 12;
float b = 6.2f;
int c;
c = convert.ToInt32(a / b + a * b);
Console.WriteLine(c);

8.
What will be the output of the following C# code?
class Program
{
    public static void Main(string[] args)
    {
        int i = 100;
        for (a = 0; a < 5; a++)
        {
            int i = 200;
            Console. WriteLine(a * i);
        }
        Console. ReadLine();
    }
}

9.
Given is the code of days(example:"MTWTFSS") which I need to split and hence create a list of days of week in strings( example:"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"). A set of code is given for this purpose but there is the error occurring in that set of code related to the conversion of char to strings. Hence, Select a C# code to solve the given error.
static void Main(string[] args)
{
    var days = "MTWTFSS";
    var daysArray = days.ToCharArray().Cast<string>().ToArray();
    for (var i = 0; i < daysArray.Length; i++)
    {
        switch (daysArray[i])
        {
        case "M":
            daysArray[i] = "Monday";
            break;
        case "T":
            daysArray[i] = "Tuesday";
            break;
        case "W":
            daysArray[i] = "Wednesday";
            break;
        case "R":
            daysArray[i] = "Thursday";
            break;
        case "F":
            daysArray[i] = "Friday";
            break;
        case "S":
            daysArray[i] = "Saturday";
            break;
        case "U":
            daysArray[i] = "Sunday";
            break;
        }
    }
    daysArray[daysArray.Length - 1] = "and " + daysArray[daysArray.Length - 1];
    Console.WriteLine(string.Join(", ", daysArray));
}

10.
Does the output remain same or different for both cases?
i.
char l ='k';
float b = 19.0f;
int c;
c = (l / convert.ToInt32(b));
Console.Writeline(c);

ii.
char l ='k';
float b = 19.0f;
int c;
c = Convert.ToInt32(l / b);
console.writeline(c);

Read More Section(Basic Syntax and Data Types in C Sharp)

Each Section contains maximum 100 MCQs question on Basic Syntax and Data Types in C Sharp. To get more questions visit other sections.