| |
GeekInterview.com > Placement Papers > TCS > Aptitude
| Print | |
Question: 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
|
| April 04, 2008 22:19:55 |
#7 |
| imran4108 |
Member Since: April 2008 Total Comments: 1 |
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 |
| |
Back To Question | |