Examveda

What will be the output of the following C# code?
static void Main(string[] args)
{            
    try 
    {
        Console.WriteLine("csharp" + " " + 1/Convert.ToInt32(0));
    }
    catch(ArithmeticException e) 
    {
        Console.WriteLine("Java");        	
    }
    Console.ReadLine();
}

A. csharp

B. java

C. run time error

D. csharp 0

Answer: Option B


Join The Discussion

Related Questions on Exception Handling in C Sharp