Friday 16 December 2011

26.Which of the following are the correct ways to define an array of 2 rows and 3 columns?

1.int[ , ] a;
2.a = new int[2, 3]{{7, 1, 3},{2, 9, 6}};
3.int[ , ] a;
4.a = new int[2, 3]{};
5.int[ , ] a = {{7, 1, 3}, {2, 9,6 }};
6.int[ , ] a;
7.a = new int[1, 2];
8.int[ , ] a;
9.a = new int[1, 2]{{7, 1, 3}, {2, 9, 6}};
A.1, 2 , 3
B.1, 3
C.2, 3
D.2, 4, 5
E.4, 5
Answer: Option B