Which of the following statements are correct? (i) All elements of an array are ints (ii) All elements of an array are floats (iii) Some elements of an array can be ints and other floats (iv) All elements of an array are chars 

Which of the following statements are correct? (i) All elements of an array are ints (ii) All elements of an array are floats (iii) Some elements of an array can be ints and other floats (iv) All elements of an array are chars  Correct Answer (i), (ii) and (iv)

Arrays a kind of data structure that can store a fixed-size sequential collection of elements of the same type.

An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type i.e.

1. All elements of an array can be Integers.

2. All elements of an array can ve floating type. 

3. All elements of an array can be character type.

All arrays consist of contiguous memory locations. The lowest address corresponds to the first element and the highest address to the last element.

Hence, option 2 is correct.

Related Questions