# C Programming Examples on Matrix

Here is the listing of C programming examples on Matrix Operations.

## 1. C Examples on Matrix Operations

A matrix is a rectangular array of numbers or symbols arranged in rows and columns. The C programs in this section perform the operations of Addition, Subtraction and Multiplication on the 2 matrices. The section also deals with evaluating the transpose of a given matrix. The transpose of a matrix is the interchange of rows and columns. The section also has programs on finding the trace of 2 matrices, calculating the sum and difference of two matrices. It also has a C program which is used to perform multiplication of a matrix using recursion.

## 2. C Examples on Matrix Types

There are three types of matrices. They are Equal Matrix, Identity Matrix and Sparse Matrix. The C programs in this section illustrate each of these matrices.

C Program to Check if 2 Matrices are Equal C Program to Check if a given Matrix is an Identity Matrix C Program to Determine if a given Matrix is a Sparse Matrix |

## 3. C Examples on Matrix Rows and Columns

The C programs in this section deals individually with the rows and columns of a given matrix. The following programs interchange the rows and columns of a given matrix and sorts the rows of matrix in ascending order and columns of a matrix in descending order.

C Program to Interchange any two Rows & Columns in the given Matrix C Program to Sort Rows of the Matrix in Ascending & Columns in Descendng Order |

## 4. C Examples on Matrix Diagonals

The C programs in this section deals with the special properties of matrices. It contains programs that evaluates the sum of the elements of each row and column, finds the frequency of odd and even numbers in the given matrix and interchanges the diagonals of a given matrix. It also contains a list of C programs to calculate the sum of each row and each column of a MxN matrix, to calculate the sum of the main and opposite diagonal elements of a MxN matrix, to compute the trace and normal of a given matrix and to display the upper triangular matrix and lower triangular matrix.