221 views

1 Answer

Best answer
1 votes
1 votes
Its a 2-d array with 2 rows and 4 columns per row.

Now if you arrange them in the array then

Row 0 will have :- 1,2,3,4

Row 1 will have:- 5,6,7,8

4 is in row 0 and its column its 3,as default in c language  array starts from location 0.

So answer will be a[0][3],b will be answer here.had they given array starts from row=1 and col=1,then answer be a[1][4] i.e a.

As nothing is given here,assume starting from 0,0 as in c language,so b is correct option here.
selected by

Related questions

0 votes
0 votes
1 answer
1
viral8702 asked Apr 29, 2022
493 views
A frame buffer array is addressed in row major order for a monitor with pixel locations starting from (0,0) and ending with (100,100). What is address of the pixel(6,10)?...
0 votes
0 votes
0 answers
2
Mayankprakash asked Nov 2, 2018
514 views
Please provide link or gatetoverflow link so that I can learn address calculation of 2d and 3d array.As I find it very tough to understand.Thanks
0 votes
0 votes
0 answers
3
Priya0612 asked Aug 23, 2018
147 views
#include <stdio.h int main(void) { char a[5] = { 1, 2, 3, 4, 5 }; char *ptr = (char*)(&a + 1); printf("%d %d\n", *(a + 1), *(ptr - 1)); return 0; }what is o/p of this pro...