Multiple choice

An array is created to store some data. The data type of the array is declared as “long” data type. What will be size of array (in bytes) if we assume that it contains only 10 elements?

  1. 20 bytes

  2. 40 bytes

  3. 10 bytes

  4. 80 bytes

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

A long data type needs 4 bytes to store an element. So, to store 10 elements, it requires 10 x 4 = 40 bytes. So, option 2 is the answer.