• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

C Quiz - 110 | Question 5

In C, 1D array of int can be defined as follows and both are correct. 
 

C
int array1D[4] = {1,2,3,4};
int array1D[] = {1,2,3,4};

But given the following definitions (along-with initialization) of 2D arrays 
 

C
int array2D[2][4] = {1,2,3,4,5,6,7,8}; /* (i) */
int array2D[][4] = {1,2,3,4,5,6,7,8}; /* (ii) */
int array2D[2][] = {1,2,3,4,5,6,7,8}; /* (iii) */
int array2D[][] = {1,2,3,4,5,6,7,8}; /* (iv) */

Pick the correct statements.
 

(A)

Only (i) is correct.
 

(B)

Only (i) and (ii) are correct.
 

(C)

Only (i), (ii) and (iii) are correct.
 

(D)

All (i), (ii), (iii) and (iv) are correct.
 

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments