Home »
MCQs »
C# MCQs
What will be the output of the following C# code? | Question 19
69. What will be the output of the following C# code?
using System;
namespace MyApplication {
class Program {
static void Main(string[] args) {
int[,] ARR = {{1,2},{3,4}};
Console.WriteLine(ARR.GetLength(0)+","+ARR.GetLength(1));
}
}
}
- 4,4
- 2,2
- Compilation Error
- Runtime Error
Answer: B) 2,2
Explanation:
The above code will print the length of the of the first and second rows of the above two-dimensional array.