Which line should you insert the code?

You are developing an application in C#.
The application uses exception handling on a method that is used to execute mathematical calculations by using integer numbers. You write the following catch blocks for the method (line numbers are included for reference only):


You need to add the following code to the method:


At which line should you insert the code?
A. 01
B. 03
C. 05
D. 07

microsoft-exams

3 thoughts on “Which line should you insert the code?

  1. try
    {
    Console.WriteLine(“Please enter a number”);
    int result = 4 / int.Parse(Console.ReadLine());
    }
    catch (DivideByZeroException ex)
    {
    Console.WriteLine(“Divide by zero exception”);
    }

    catch (ArithmeticException ae)
    {
    Console.WriteLine(“Arithmetic Exception”);
    }

    catch (ArgumentException are)
    {
    Console.WriteLine(“Bad Argument”);
    }

    catch (Exception e) {
    Console.WriteLine(“General Error”);
    }

    Console.ReadLine();

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.