41.1k views
1 vote
A single dimensional array can be declared as int a[10] or int a[] = {1, 2, 3, 4}. It means specifying the number of elements is optional in 1-D array. Given the array above, which statement would change the fifth element to equal 1? void function() { ... }

1) a[3] = 23;
2) a[1] = 1;
3) a[5] = 1;
4) a[5] = 6;
5) a[10] = 5

2 Answers

1 vote
1) a[3] = 23 is the correct answer
User Jay Stevens
by
7.0k points
7 votes
Answer:
The answer is (3)
Explanation:
Just did the test
User Morfys
by
6.7k points