15,746 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

3 Answers

Best answer
14 votes
14 votes

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

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

1 votes
1 votes
2 answers
3
GO Classes asked Aug 6, 2022
1,121 views
In which of the following case(s) character array must end with null char?char c[] = "GATE";char c[] = {'2', '0', '2', '3'};char c[4] = "GATE";char c[16] = "2023";
3 votes
3 votes
3 answers
4
go_editor asked Jun 15, 2016
2,775 views
Process isA program in high level language kept on diskContents of main memoryA program in executionA job in secondary memory