retagged by
19,499 views
3 votes
3 votes

Consider an array $A\left[20, 10\right]$, assume $4$ words per memory cell and the base address of array $A$ is $100$. What is the address of $A\left[11, 5\right]$ ? Assume row major storage.

  1. $560$
  2. $565$
  3. $570$
  4. $575$ 
retagged by

3 Answers

Best answer
5 votes
5 votes

Each cell needs 4 words

  • A[0][0], A[0] [1],.....A[0][9] needs 4x10 =40 words.
  • Since array starts at 100, A[0][9] will be at 100+40=140 th location.
  • Similarly, from A[0][0] to A[10][9] there are 11x10=110 elements.
  • From A[11][0] to A[11][5]there are 5 elements.
  • Total 115 elements are present before A[11][5].
  • Hence A[11][5] will be at 100+ 4x115 = 560

Answer is A

selected by
0 votes
0 votes

A[20][10]

to reach A[11][5]

we have to cross 11 rows and each row contains 10(no. of columns) elements and in 12th row we have to cross 5 elements 

total elements to cross= $11*10+5=115$

each element occupies 4 words space 

total space = $4*115=460$

address of $A[11][5] = base address + space occupied by elements before it$

                                $=100+460=560$

option (A)

Answer:

Related questions

2 votes
2 votes
2 answers
3
makhdoom ghaya asked Jul 20, 2016
3,304 views
What will be the output of the following $'C'$ code ?main () { int x = 128; printf ("\n%d", 1+x++); }$128$$129$ $130$ $131$
2 votes
2 votes
1 answer
4
makhdoom ghaya asked Jul 24, 2016
1,562 views
Match the following $:$ $\begin{array}{clcl} & \textbf{List – I} && \textbf{List – II} \\ \text{a.} & \text{Call Control protocol} &\text{i.} & \text{Interface b...