For the following problem, write a program or a program segmentthat performs the specified action:
1. A try block contains a function call to mystery that couldproduce any of the following exceptions:
DivideByZeroException, InvalidInputException, ArithmeticExceptionor InvalidCastException.
Class ArithmeticException is a base class of DivideByZeroException.Write the try block and necessary
catch blocks. Add a catch block to handle all other possibleexceptions.
Expert Answer
An answer will be send to you shortly. . . . .