Arrays

Q1:
Which of the following are the correct ways to define an array of 2 rows and 3 columns?
  1. int[ , ] a;
    a = new int[2, 3]{{7, 1, 3},{2, 9, 6}};
  2. int[ , ] a;
    a = new int[2, 3]{};
  3. int[ , ] a = {{7, 1, 3}, {2, 9,6 }};
  4. int[ , ] a;
    a = new int[1, 2];
  5. int[ , ] a;
    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

ANS:B - 1, 3

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.