4.In two dimensional array X(7,9) each element occupies 2 bytes of memory.If the address of first element X(1,1)is 1258 then what will be the address of the element X(5,8) ? whats the ans
RE: 4.In two dimensional array X(7,9) each element occ...
Ans is 1344 and it is calculated asfirst add 8 since in first row 8 elements then for the next 3 row add 9 nd for the last row add 8 so the total comes to 43 multiply with 2 add it to 1258 it gives 1344
RE: 4.In two dimensional array X(7,9) each element occ...
here, the address of first element x[1][1] is 1258 and also 2 byte of memory is given.now, we have to solve the address of element x[5][8], therefore, 1258+ 5*8*2 = 1258+80 = 1338 so the answer is 1338.
RE: 4.In two dimensional array X(7,9) each element occupies 2 bytes of memory.If the address of first element X(1,1)is 1258 then what will be the address of the element X(5,8) ? whats the ans
formulae is X(5,8)=X(N,M) X(7,9)=X(R,C) X(5,8)=BASE+C*(M-1)*SIZE+(N-1)*SIZE WHERE SIZE=2BYTES BASE=1258 X(5,8)=1258+9*7*2+4*2