ExamVeda
Login
Home
File Handling and Input Output in C Sharp
?

What will be the output of the following C# code?
static void Main(string[] args)
{
    int a = 10, b = 0;
    int result;
    Console.Out.WriteLine("This will generate an exception.");
    try
    {
        result = a / b; // generate an exception
    }
    catch (DivideByZeroException exc)
    {
        Console.Error.WriteLine(exc.Message);
    }
    Console.ReadLine();
}

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