Sail E0 Webinar
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(); }
Options:
A .  A
B .  B
C .  B C
D .  Run time error
Answer: Option C


finally keyword is used to execute before catch and try block is executed.
Output : B C



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers