in Programming in C
15,744 views
6 votes
6 votes

A one dimensional array A has indices 1....75. Each element is a string and takes up three memory words. The array is stored at location 1120 decimal. The starting address of A[49] is

  1. 1267
  2. 1164
  3. 1264
  4. 1169
in Programming in C
15.7k views

1 comment

nice
0
0

3 Answers

14 votes
14 votes
Best answer

Address of array + index *size of element  when index starts from 0

In above question index starts from 1

so given Address of array=1120 , index=49 , size of element=3

Address=1120+(49-1)*3 =1120+48*3 =1120+144 =1264

Option C

selected by
0 votes
0 votes

Option. C is right

0 votes
0 votes

Starting index = 1.

Starting index address = 1120.

 

For index = 49

Starting address would be $1120+(49-1)*3$

Why? Because doing $1120+(49)*3$ will give us the "ending address" of A[49] => Starting address of A[50].

 

So, $1120+(48)*3$ = 1264. Option C

//Think of it as the question asked for the "ending address" of index 48.

Answer:

Related questions