Computer Science, asked by ZaidAmman, 4 months ago

Consider the following declaration of a two-dimensional array in C Char a[100][100] Assuming that the main memory is one byte-addressable and that array is stored starting form memory address 0, the address of A[40][50] is ____

Select one:

a. 4040

b. 5050

c. 4050

d. 5040

Answers

Answered by norzinnnnnnnnn
0

Explanation:

b) 5050 is the answer

please mark me brainleist and follow me

Answered by rahul123437
0

The main memory is one byte-addressable and that array is stored starting form memory address 0, the address of A[40][50] is b)4050

Explanation:

In C, arrays are always stored in the row-major form.

The 2−D array's location is: loc(a[i][j]) =BA+((i-lb1)*NC+(j-lb2))*c

where,

BA - Base Address

NC - No. of columns

c - memory size allocated to data type of array a[lb1.........ub1][lb2................ub2]

BA=0, NC=100, c=1, a[0.........99][0...........99] , so lb1=0, lb2=0

loc(a[40][50])=0+[(40-0)*100+(50-0)]*1\\=0+[4000+50]*1\\=4050

Similar questions