Q44
What will be the output of the following C# code? try int []a = 1, 2, 3, 4, 5; for (int i = 0; i < 5; ++i) Console.WriteLine(a[i]); int x = (1 / Convert.ToInt32(0)); catch(IndexOutOfRangeException e) Console.WriteLine("A"); catch(ArithmeticException e) Console.WriteLine("B"); Console.ReadLine();
A.
1234
B.
12345
C.
Run time error
D.
12345B
AnswerAnswer: Option D
Solution
Answer: Option D
No explanation is given for this question Let's Discuss on Board