19,702 views
6 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
19 19 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
2 2 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:
Position:
Show:

Related questions

32 32 votes
3 answers 3 answers
15.3k
15.3k views
gatecse asked Sep 21, 2014
15,259 views
Let $f(x)$ be the continuous probability density function of a random variable $x$, the probability that $a < x \leq b$, is :$f(b-a)$$f(b) - f(a)$$\int\limits_a^b f(x) dx...
17 17 votes
2 answers 2 answers
9.8k
9.8k views
Rucha Shelke asked Sep 26, 2014
9,829 views
Consider the following code written in a pass-by-reference language like FORTRAN and these statements about the code. subroutine swap(ix,iy) it = ix L1 : ix = iy L2 : iy ...
2 2 votes
2 2 answers
2.8k
2.8k views
GO Classes asked Aug 6, 2022
2,794 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";
4 4 votes
3 answers 3 answers
3.9k
3.9k views
go_editor asked Jun 15, 2016
3,901 views
Process isA program in high level language kept on diskContents of main memoryA program in executionA job in secondary memory