Is the answer correct? Shouldn't it be twoD[1][3] instead?Quote:
Write an expression that accesses element 4 in subarray 2 in a two-dimensional array called twoD. The answer given in the book is: twoD[2][4].
Please let me know your opinion. Thanks.
Printable View
Is the answer correct? Shouldn't it be twoD[1][3] instead?Quote:
Write an expression that accesses element 4 in subarray 2 in a two-dimensional array called twoD. The answer given in the book is: twoD[2][4].
Please let me know your opinion. Thanks.
It's a subtle question which could be interpreted either way.
If they were asking for the fourth element of the second subarray, you would be absolutely correct. Since they're identifying them by number, it is less clear what is intended.