In C language, the entries of a matrix are allocated in rows. For example:

The matrix

*a*

*d*

*g*

*b*

*e*

*h*

*c*

*f*

*i*

is stored as [ *a* *b* *c* *d* *e* *f* *g* *h* *i* ]

In FORTRAN, the entries of a matrix are allocated in column. For example:

The matrix

*a*

*d*

*g*

*b*

*e*

*h*

*c*

*f*

*i*

is stored as [ *a* *d* *g* *b* *e* *h* *c* *f* *i* ]