Computer Science, asked by ranjanajhadar7357, 11 months ago

The declaration int arr[2][5]; will allocate how much bytes

Answers

Answered by QGP
6
40 bytes.

int arr[2][5] creates a two-dimensional array, with two rows and five columns. 

A typical integer type variable requires 4 bytes of space. 

Here we are creating two rows and 5 columns. So, the total number of variables that can be stored is 2\times 5 = 10 variables. 

Since one integer type variable takes 4 bytes space, 10 such variables will take a space of 4\times 10 = 40 \, \, bytes

Thus, the answer is 40 bytes.



[NOTE: In some old systems, int used to be 2 bytes for each variable. In that case, the answer would become 20 bytes. However, modern standards are that of 4 bytes for int data type]

Similar questions