For a multidimensional short array X[5][24], find the number of bytes required.
3 Likes
The formula to calculate total number of bytes required by a two-dimensional array is as follows:
total bytes = number-of-rows x number-of-columns x size-of-base-type = 5 x 24 x 2 (since short requires 2 bytes in memory) = 240 bytes
Answered By
1 Like
Declare an array of 5 ints and initialize it to the first five even numbers.
Write a statement that displays the value of the second element in the long array balance.
For a multidimensional array B[9][15] find the total number of elements in B.
How are the 2-D arrays stored in the memory?