3,957 views
0 votes
0 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 starting at location 1120 decimal. The starting address of A[49] is 

A.1167B.1164
C.1264D.1169

I think the location of A[49] will be  1264  because location of A[49] is 1264= (1120+(48*3))as it takes three memory words.is this correct answer?Does each memory word represents a single character? or am i doing something wrong?

3 Answers

Best answer
5 votes
5 votes
yes you are right ans is 1264
selected by
0 votes
0 votes

the answer should be 1120 + (49 * 3) = 1167 because there are 49 elements in array before A[49].

for understanding , for A[0] = 1120 +(0*3) = starting address

                           for a[1]= 1120 + (1*3) and so on....

0 votes
0 votes
Ans: C

One element takes three memory words so memory location 1120 , 1121 , 1123 stores first element.

A[49] will be stored at location 1264.

(1120+(48*3))=1264

Related questions

0 votes
0 votes
1 answer
1
viral8702 asked Apr 29, 2022
447 views
A frame buffer array is addressed in row major order for a monitor with pixel locations starting from (0,0) and ending with (100,100). What is address of the pixel(6,10)?...
30 votes
30 votes
4 answers
2
Ishrat Jahan asked Oct 28, 2014
9,450 views
What is the output printed by the following C code?# include <stdio.h int main () { char a [6] = "world"; int i, j; for (i = 0, j = 5; i < j; a [i++] = a [j ]); printf ("...
0 votes
0 votes
1 answer
4
stblue asked Oct 18, 2017
742 views
#include <stdio.h>int main(){ int a[] = {50, 60, 10, 30, 40, 20 }; int *b[] = {a+3, a+4, a, a+2, a+1, a+5 }; int c = b; c++; printf("%u, %u, %u\n", c-b, *...