Consider a two dimensional array A[1…10][3….8] that is c...
Two-dimensional arrays are also known as matrices. They are defined as a collection of elements arranged in rows and columns. Each element in the array is accessed using two indices: the row index and the column index.
In the case of the given array A[1, n], it represents a matrix with only one row and n columns. This means that there is only one row in the matrix, and the number of columns can vary.
The size of the array A is defined as A[1, n], where 1 represents the row index and n represents the number of columns. The row index is fixed at 1, meaning that there is only one row in the matrix.
To access an element in the array A, you would use the syntax A[1, j], where j represents the column index. This allows you to access any element in the row, regardless of the number of columns.
For example, if A[1, n] represents a matrix with one row and 5 columns, you can access the element in the second column using A[1, 2].
Overall, the two-dimensional array A[1, n] represents a matrix with one row and a variable number of columns.
Consider a two dimensional array A[1…10][3….8] that is c...
Given,
Number of rows = 10
Number of columns = 6
Starting of row indexing (n) = 1
Starting of column indexing (m) = 3
In the case of column major order,
Address of A[i][j] = ((j − m) × no. of rows + (i − n) × size of element + base address of A.
So, address of A[i][j] = ((7 − 3) × 10 + (5 − 1)) + 1000
= 1044
Hence, the correct answer is 1044.