ExamVeda
Login
Home
Exception Handling in C Sharp
?

What will be the output of the following C# code?
public  static void Main(string[] args)
{
    try
    {
        int a, b, c = 5;
        b = 0;
        a = c / b;
        Console.WriteLine("A");
    }
    catch (ArithmeticException e)
    {
        int c = 5;
        int i = 10;
        int z = 2 * c - i;
        Console.WriteLine("B");
        Console.WriteLine(z);
    }
    Console.ReadLine();
}

Answer & Solution
Correct Answer: Option C
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.