TCS
Company
In a 2 dimentional array x(8,7),with each element occupying 2 bytes of memory,with the address of first element x(1,1) is 3000,find the address of x(2,3).
Read Solution (Total 9)
-
- answer will be 3018 as starting with x(1,1) is 3000,(1,2) is 3002 similarly (1,7) is 3012 now since memory is contiguous then (2,1) will be 3014 and similarly (2,3) will be 3018
- 14 years agoHelpfull: Yes(18) No(1)
- sorry its 3018
- 14 years agoHelpfull: Yes(3) No(0)
- 1,1 to 2,3 there r 10 element
3000+ 2*10=3020 ans - 14 years agoHelpfull: Yes(2) No(7)
- answer is 3018 because the 1st elements address is 3000.2,3 means 10 elements.
- 14 years agoHelpfull: Yes(2) No(1)
- 3018..
coz each element occupies 2 bytes..calculating we can find x(2,3)=3018 - 12 years agoHelpfull: Yes(1) No(0)
- it depends on memeory allocation technique . it can be row-wise or column-wise . if row-wise answer is 3018 and column-wise is 3018
- 12 years agoHelpfull: Yes(0) No(1)
- Answer :3018.
Explanation : In case of 8,7 two-dim array x(2,3) will become the 10th element in the array.
If each element is occupying 2 bytes where first element is allocated at 3000, 10th element will be allocated at 3018 memory location. - 12 years agoHelpfull: Yes(0) No(0)
- x contain 7 elements per row and 8 elements per column
RMO:
x(2,3) is 3rd element in 2nd row..thus system will store 7(1st row) + 2(in 2nd row) elements before storing x(2,3)i.e 9*2=18 memory cells.. so x(2,3) will be stored in (3000+18)3018.
CMO:
x(2,3) is 2nd element in 3rd column.. thus system will store 8(1st column) + 8 (2nd column) + 1 (3rd column) elements before storing x(2,3)i.e 17*2=34 memory cells.. so x(2,3) will be stored in (3000+34)3034.
- 12 years agoHelpfull: Yes(0) No(1)
- 3018.x(2,3) is the 10th element in the array.1st element is at 3000,2nd at 3002...likewise 10th element will be at 3018
- 12 years agoHelpfull: Yes(0) No(0)
TCS Other Question