there are some products or programmers, where we have to store data in the form of a table containing both rows and columns, in this context we should use one more subscript to control the columns. Two-dimensional arrays are generally referred as a matrix with both row and column. Here the data type and name of an array will be same and we should choose the size of row and column of an array or leave empty, it detects automatically.
so, in this example, the array is about marks of a student in three tests. the row is the roll no of student and column is the test NO .so let’s look this array in tabular form with some examples
we can represent the above matrix array as single individual elements .and we can initialize value for each part using index numbers of rows and columns .every element in the matrix is represented by i,j .i as rows and j as columns .
The above example is represented in the form of single individual elements down below.
so ,the sequence of the assignment of arrays will be in row manner. We can initialize the separate elements of an array individually by using index numbers of row and column as shown in the above example.
we can use the above method and this method as similar to representing single dimensional arrays.
the above example can be represented in this way too
if no value is assigned to respective array element,it is considered as value zero . lets see one example of adding two matrices