Vidyalelo
C# Programming · Q40

Exception Handling in C Sharp

Programming · C# Programming · question 40

Q40

What will be the output of the following C# code? class student int []scores = new int[3] 13, 32, 24; public int this[int index] get if (index s[i]) Console.WriteLine(" scores1 had greater value :" + scores1[i]); else Console.WriteLine("scores had greater value :" + s[i]); Console.ReadLine();

A.
0
B.
Compile time error
C.
Run time error
D.
scores had greater value : 13
scores had greater value : 32
scores1 had greater value : 40
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board