adplus-dvertising
frame-decoration

Question

What would be the output of following code snippet?
{
     try 
     {
         int a, b;
         b = 0;
         a = 5 / b;
         Console.WriteLine("A");
     }
     catch(ArithmeticException e) 
     {
         Console.WriteLine("B");
     }
     finally
     {
         Console.WriteLine("C");
     }
     Console.ReadLine();
 }

a.

A

b.

B

c.

B C

d.

Run time error

Posted under C# programming

Answer: (c).B C

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What would be the output of following code snippet?