in Programming in C
851 views
0 votes
0 votes
Caption

 

in Programming in C
851 views

4 Comments

what is the size of the word ?
0
0

ANS(1)  array is given as a=$\begin{bmatrix} 1& 2 & 3 & 4 &5 & 6 & 7 &8 &9 \\ 10& 11& 12 & ..& ..& &.. & &18 \\ 19 &20 &21 & .. &. & ..& &. . &27 \\ .. &.. & & .. & & ...&... &.. & ..\\ & & & & & & & & \\ & & & & & & & & \\ & & & & & & & & \\ & & & & & & & & \\ ..& ... ..&. .. ..& &.. & .. .& ..& .. & \\ 82 & 83 & 84 &85 &86 &87 &88 &89 &90 \end{bmatrix}$

now the address 67 first find 67-29=38 

word size =2

now assume you have to find out address of element 10  , it will be 29 +2=31 as array is stored in column major order 

similarly , for address 67 we can find number of elements between these addresses i.e.  67-29=38

#elements=38/2=19 it will be a[10][2]  since a[1][2]=2 a[2][2]=11  similarly  (like A.P.) a[10][2] =2+(10-1)9=83

ANS(2) I think option A is correct 

using column major order 29+[(7-1)*10+6]*2=161

1
1

@hitendra singh

I think you put the wrong formula for the column-major order.

ans will be 181.

0
0

Please log in or register to answer this question.

Related questions

0 votes
0 votes
0 answers
2
Na462 asked in Programming in C Nov 19, 2018
527 views
Na462 asked in Programming in C Nov 19, 2018
by Na462
527 views