Computer Science, asked by bhanusai897, 11 months ago

Given an array int marks.[]={99,67,78,56,88,90,34,85} calculate the address of marks [4], if base addressv=1000

Answers

Answered by swarapatel567
5

Answer:1006

Explanation:

By adding 1000 to 6

Answered by priyarksynergy
0

Given an array of integers and the stating address of this array, Find the address of data at fourth index.

Explanation:

  • Let there be an array of 'N' integers having base address 'x' (that is the address of the first element of the array is 'x').
  • Then the address 'A' of nth index out of 0-(N-1) indices of the size of each integer data type given to be 'b' bytes is given by,    A=x+b(n) \ \ \ \ \ \ \ \  \ \  \ \ ->0\leq n \leq  (N-1)
  • In general the size of integer data type is considered to be 4\ bytes. If the size of integer is different the above formula can be used to determine the address.
  • Now here we have, x=1000\ \ \  \ \  \ \ \  \ b=4\ \  \ \ \ \ \ \ \ \  \ n=4
  • Hence the address of marks[4] is,  
  •                           A_4=1000+(4)4\\->A_4=1016     ---->Answer
Similar questions