CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider on array arr[0 .... 10] which is of character type and occupies 2 byte memory each, then what would be the address of the element arr[7].
Note : Consider first value is stored at 50.

Open in App
Solution

We know :
A[i] = B.A. + (i - start index) × size
Here, B.A. = 50
i = 7, size = 2 bytes,
start index = 0
A[7] = 50 + (7 - 0) × 2
= 50 + 14
= 64
A[7] = 64.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Sets and Their Representations
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon