32.
In C#, what is the purpose of the using statement in exception handling?

35.
What is the purpose of the catch block in C# exception handling?

37.
In C#, what happens if an exception is thrown inside a finally block?

38.
What is the purpose of the try-catch block in C#?

40.
What will be the output of the following C# code?
class student
{
    int []scores = new int[3] {13, 32, 24};
    public int this[int index]
    {
        get
        {
            if (index < 3)
            return scores[index];
            else
            {
                Console.WriteLine("invalid index");
                return 0;
            }
        }
        private  set
        {
            if (index < 3)
            scores[index] = value;
            else
            Console.WriteLine("invalid index");
        }
    }
}
class Program
{
    public static void Main(string[] args)
    {
        student s = new student();
        int[] scores1 = new int[3] {8, 19, 40};
        for (int i = 0; i < 3; i++)
        {
            if (scores1[i] > s[i])
            {
                Console.WriteLine(" scores1 had greater value :" + scores1[i]);
            }
            else
            {
                Console.WriteLine("scores had greater value :" + s[i]);
            }
        }
        Console.ReadLine();
    }
}

Read More Section(Exception Handling in C Sharp)

Each Section contains maximum 100 MCQs question on Exception Handling in C Sharp. To get more questions visit other sections.