1,844 views
1 votes
1 votes

Let's say we have an array of 5 elements.

Array index starts from 0 

Base address of Array = 100 

size of each element is 2 ie it's an int array

Now we want to find the 2nd element ie A[2]. 

So, the procedure is like - 

A[2] = Base address + (index*size of each element in memory)

A[2] = 100+(2*2)

Now how to find the BOLD text ie address of 2nd element in BINARY?!

Thanks

1 Answer

0 votes
0 votes
i think you can write the code for conversion of decimal to binary because we always get decimal values and the address value is equivalent to the address in binary.

if i am wrong than correct me.

Related questions

16 votes
16 votes
3 answers
1
shikharV asked Dec 4, 2015
15,596 views
A is an array $[2.....6, 2.....8, 2.......10]$ of elements. The starting location is $500$. The location of an element $A(5, 5, 5)$ using column major order is __________...
3 votes
3 votes
3 answers
2
vishwa ratna asked Dec 12, 2016
2,636 views
I am not getting the answer , (11*8*13+67)*4+ base address =400+4844= 5244.But the answer is 5336, please explain.similar question is here: https://gateoverflow.in/29361/...
2 votes
2 votes
1 answer
3
shikharV asked Nov 16, 2015
2,350 views
Please solve the above problem. Given answer: D
0 votes
0 votes
5 answers
4
radha gogia asked Sep 30, 2015
1,664 views
If I am given an array $X$ of $n$ distinct integers which is interpreted as a complete binary tree, so if the parent is at index $i$, then it's left child would be at ind...