Q99
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();
A.
This will generate an exception
B.
0
C.
Compile time error
D.
This will generate an exception
Attempted to Divide by Zero
AnswerAttempted to Divide by Zero
Answer: Option D
Solution
Answer: Option D
No explanation is given for this question Let's Discuss on Board