What will be the output of the program if the array begins at 1000 and each integer occupies 2 bytes? Void main() { int arr[2][2] = { 1, 2, 3, 4 }; printf("%u, %u", arr+1, &arr+1); } select one:
a. 1008 1002
b. 1002 1008
c. 1002 1002
d. 1004 1008?
Answers
Answered by
1
Answer:
1004 1008abcd
Explanation:
cap formula
Answered by
0
The output of the given program if the array begins at 1000 and each integer occupying 2 bytes will be 1004 1008. Hence, option(d) is the correct answer.
- In any 2 dimensional array, "pointer to an array of 2 ints" is used as a reference to the array.
- The pointer to the first element of the 2nd row of an array will be arr+1 and its location will be 1000 + 2*2 = 1004.
- &arr is a type of "pointer to an array of 2 arrays of 2 ints" that will be 4 ints.
- &arr+ 1 will point to the location 1000 +4 *2 = 1008
Similar questions
English,
5 months ago
English,
5 months ago
Computer Science,
10 months ago
Business Studies,
10 months ago
English,
1 year ago
Science,
1 year ago