Vidyalelo
C# Programming · Q99

File Handling and Input Output in C Sharp

Programming · C# Programming · question 99

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
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board