Computer Science, asked by reenafredy1, 26 days ago

For an array declared as int arr[50], calculate the address of arr[35], if Base(arr) =1000 and width=2​

Answers

Answered by vinodbishnoi56029
17

Answer:

Explanation:

BASE(Arr)=1000 ,Width=2

address(35)=Base(add.)+w(35-L.B)

1000+2(35)=1070

address of arr[35] =1070

Answered by priyarksynergy
8

The address of arr[35] for the given array is 1070.

Explanation:

  • Let there be an array of 'n' elements having base address 'x'.
  • Then the size of each element in memory address is referred as the width of the array. Let that be denoted by 'b'.
  • Then the address 'A' of 'i' index of the array is given by, A=x+bi\ \ \  \ \ \ \ \ \ \ \ \  \ \ ->0\leq i\leq (n-1)  
  • Here, we have an array 'arr' and n=50,\  i=35,\  x=1000,\  b=2.
  • Then the required address is given by, A_{35}=1000+2(35)\ \ \  \ \ \ \ \ \ \ ->A_{35}=1070
Similar questions