adplus-dvertising
frame-decoration

Question

Choose the correct output for the given set of 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

Posted under C# programming

Answer: (b).java

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Choose the correct output for the given set of code: