Arrays on C# related Questions and Answers


Question :   Which is the correct way of defining and initializing an array of 3 integers?
1. int[] a={78, 54};
2. int[] a; a = new int[3]; a[1] = 78; a[2] = 9; a[3] = 54;
3. int[] a; a = new int{78, 9, 54};
4. int[] a; a = new int[3]{78, 9, 54};
Answer :   4 - int[] a; a = new int[3]{78, 9, 54};  

* Be the First to Post a Comment.

Submit comment :


Captcha Image
Reload

Ask Question

Captcha Image
Reload

Note : Name and Email never shown.





Subscribe


Become a part of EducationForever. Subscribe to our FREE Newsletter