An integer array of size 10 is declared in a C program. The memory location of the first byte of the array is 1000. What will be the location of the 8th element of the array? (Assume integer takes 4 bytes of memory and the element stored at 1000 is identified as 1st element).
a) 1028
b) 1032
c) 1024
d) 1036
Answers
Answered by
0
Concept
- An array is a collection of memory locations, or "boxes," each of which contains a single piece of data and which has the same name as the others.
- An array is a group of related data pieces kept in close proximity to one another in memory.
- The sole way to retrieve each data piece directly is by using its index number, making it the most basic data structure.
Explanation
- first element location = 1000
- 2nd element location = 1004
- like wise...8th element location = 1000+28=1028 that is; 1000+(N-1)*4 = 1000+(8-1)*4 so it will be 1028
Hence the the location of the 8th element of the array will be 1028 which is option (A)
#SPJ3
Answered by
2
Answer:
The the location of the 8th element of the array will be 1028 which is option (A)
Explanation:
- An array is a collection of memory locations, or "boxes," each of which contains a single piece of data and has the same name as others.
- it is a group of related data pieces kept in close proximity to one another in memory.
- The sole way to retrieve each data piece directly is by using its index number, making it the most basic data structure.
1st element location = 1000
2nd element location = 1004
like wise...8th element location = 1000+28=1028 that is; 1000+(N-1)x4 = 1000+(8-1)x4 so it will be 1028
Hence the the location of the 8th element of the array will be 1028 which is option (A)
Similar questions
Computer Science,
14 hours ago
Math,
14 hours ago
Hindi,
14 hours ago
Computer Science,
1 day ago
Geography,
1 day ago
Chemistry,
8 months ago