TCS
Company
General Ability
General Knowledge
In a two-dimensional array, X (9, 7), with each element occupying 4 bytes of memory, with the address of the first element X (1, 1) is 3000, find the address of X (8, 5).
Read Solution (Total 3)
-
- According to row major:
LOC(A[J, K])= Base(A)+W[N(J-LB)+(K-LB)]
where, N is number of columns in the Array, W is number of bytes required to store a single element, and LB is the Lower Bound of the Array.
So,
3000+4*[7*(8-1)+(5-1)]
3000+4*[53]
3212
- 10 years agoHelpfull: Yes(8) No(0)
- 4696
each element carry 32 bits
total bits in first row=32*7=224
total for 7 rows=7*224=1568
in 8th row=4*32=128
address of X(8,5)=3000+1568+128
- 13 years agoHelpfull: Yes(3) No(13)
- Ans 3248
[((9-1)*7)+(7-1)]*4 byte
3000+248
3248 100% Correct - 13 years agoHelpfull: Yes(2) No(9)
TCS Other Question