ExamVeda
Login
Home
Exception Handling in C Sharp
?

What will be the output of the following C# code?
class program
{
    static void main(string[] args)
    {
        int i = 5;
        int v = 40;
        int[] p = new int[4];
        try
        {
            p[i] = v;
        }
        catch(IndexOutOfRangeException e)
        {
            Console.WriteLine("Index out of bounds");
        }
        Console.WriteLine("Remaining program");
    }
}

Answer & Solution
Correct Answer: Option B
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.