ExamVeda
Login
Home
Exception Handling in C Sharp
?

What will be the output of the following C# code snippet?
class program
{
    public static void Main(string[] args)
    {
        try 
        {
            int a = args.Length;
            int b = 1 / a;
            Console.WriteLine(a);
        }
        catch (ArithmeticException e) 
        {
            Console.WriteLine("1");
        }
        Console.ReadLine();
    }
}

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.