Multiple choice

Which of the following is an invalid array declaration?

  1. int a[ ];

  2. int a[5];

  3. int a[ ] = {4, 2, 5, 6, 7};

  4. int a[5] = {4, 2, 5, 6, 7};

  5. none of above

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

int a[ ]; is an invalid array declaration because size of array is not specified.