What will be the output of the following C# code snippet? [code] class program { public static void Main(string[] args)

Phương Quyên

New member
What will be the output of the following C# code snippet?
Code:
   class program
   {
       public static void Main(string[] args)
       {
           try 
           {
               int a = args.Length;
               int b = 1 / a;
               Console.WriteLine(a);
           }
           catch (ArithmeticException e) 
           {
               Console.WriteLine("1");
           }
           Console.ReadLine();
       }
   }
A. 0
B. 1
C. Compile time error
D. Runtime error
 

Tìm kiếm

Back
Top