C language: output a 4x5 matrix

Simple c
outputs a matrix.
Insert picture description here
Insert picture description here
Nested loops are used here, and I feel that a little algorithm is also used;
first, the outermost layer is the number of columns of the control matrix, and the inner layer of loops is the number of rows of the control matrix, and when the number of rows reaches the fifth, it needs to output A line break. According to the law of the matrix, we can know that each number is equal to the number of rows x the number of columns.

Guess you like

Origin blog.csdn.net/m0_52405419/article/details/115355090