C# Programming - Arrays - Discussion
Discussion Forum : Arrays - General Questions (Q.No. 12)
12.
Which of the following is the correct way to define and initialise an array of 4 integers?
-
int[] a = {25, 30, 40, 5}; -
int[] a; a = new int[3]; a[0] = 25; a[1] = 30; a[2] = 40; a[3] = 5; -
int[] a; a = new int{25, 30, 40, 5}; -
int[] a; a = new int[4]{25, 30, 40, 5}; -
int[] a; a = new int[4]; a[0] = 25; a[1] = 30; a[2] = 40; a[3] = 5;
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers