There’s more…

One thing that you might notice while entering the elements of the matrix is that there are two ways of doing it.

  1. The first method is that you press Enter after inputting each element as follows:
3
9
7
1
5
4

The values will be automatically assigned to the matrix in row-major order, in other words, 3 will be assigned to matA[0][0], 9 will be assigned to matA[0][1], and so on.

  1. The second method of entering elements in the matrix is as follows:
6 2 8 1
3 9 4 0
5 3 1 3

Here, 6 will be assigned to matB[0][0], 2 will be assigned to matB[0][1], and so on.

Now, let's move on to the next recipe!