C program to find determinant of a matrix

Write a C program to read elements in a matrix and find determinant of the given matrix. C program to find determinant of a 2×2 matrix and 3×3 matrix. Logic to find determinant of a matrix in C programming.

Example

Input

Input elements in 2x2 matrix: 
1 2
3 4

Output

Determinant of the matrix = -2

Read more

C program to check symmetric matrix

Write a C program to read elements in a matrix and check whether the given matrix is symmetric matrix or not. How to check symmetric matrix in C. Logic to check symmetric matrix in C programming.

Example

Input

Input matrix elements: 
1 2 3
2 4 5
3 5 8

Output

Given matrix is symmetric matrix.

Read more

C program to find transpose of a matrix

Write a C program to read elements in a matrix and find transpose of the given matrix. How to find transpose of a given matrix in C. Logic to find transpose of a matrix in C programming.

Example

Input

Input elements in matrix: 
1 2 3
4 5 6
7 8 9

Output

Transpose: 
1 4 7
2 5 8
3 6 9

Read more

C program to check sparse matrix

Write a C program to read elements in a matrix and check whether matrix is Sparse matrix or not. C program for determining sparse matrix. How to check sparse matrix in C. Logic to check sparse matrix in C programming.

Example

Input

Input elements in matrix: 
1 0 3
0 0 4
6 0 0

Output

The given matrix is Sparse matrix

Read more

C program to check Identity matrix

Write a C program to read elements in a matrix and check whether matrix is an Identity matrix or not. C program for finding Identity matrix. Logic to check identity matrix in C programming.

Example

Input

Input elements in matrix: 
1 0 0
0 1 0
0 0 1

Output

It is an Identity matrix

Read more

C program to find upper triangular matrix

Write a C program to read elements in a matrix and check whether the matrix is upper triangular matrix or not. C program to check upper triangular matrix. Logic to find upper triangular matrix in C programming.

Example

Input

Input elements of matrix:
1 2 3
0 5 6
0 0 9

Output

Matrix is upper triangular

Read more

C program to find lower triangular matrix

Write a C program to read elements in a matrix and check whether the matrix is a lower triangular matrix or not. C program to find whether the matrix is lower triangular or not. Logic to find lower triangular matrix in C programming.

Example

Input

Input elements in matrix:
1 0 0
4 5 0
7 8 9

Output

Matrix is lower triangular

Read more

C program to interchange diagonals of a matrix

Write a C program to read elements in a matrix and interchange elements of primary(major) diagonal with secondary(minor) diagonal. C program for interchanging diagonals of a matrix. Logic to interchange diagonals of a matrix in C programming.

Example

Input

Input matrix elements: 
1 2 3
4 5 6
7 8 9

Output

Matrix after interchanging its diagonal:
3 2 1
4 5 6
9 8 7

Read more

C program to find sum of each row and columns of a matrix

Write a C program to read elements in a matrix and find the sum of elements of each row and columns of matrix. C program to calculate sum of rows and columns of matrix. Logic to find sum of each row and columns of a matrix in C programming.

Example

Input

Input elements in array: 
1 2 3
4 5 6
7 8 9

Output

Sum of row 1 = 6
Sum of row 2 = 15
...
...
Sum of column 3 = 18

Read more

C program to find the sum of opposite diagonal elements of a matrix

Write a C program to read elements in a matrix and find the sum of minor diagonal (opposite diagonal) elements. C program to calculate sum of minor diagonal elements. Logic to find sum of opposite diagonal elements of a matrix in C programming.

Example

Input

Input elements in array:
1 2 3
4 5 6
7 8 9

Output

Sum of minor diagonal elements = 15

Read more