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

C program to find sum of main diagonal elements of a matrix

Write a C program to read elements in a matrix and find the sum of main diagonal (major diagonal) elements of matrix. Find sum of all elements of main diagonal of a matrix. Logic to find sum of main diagonal elements of a matrix in C programming.

Example

Input

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

Output

Sum of main diagonal elements = 15

Read more

C program to check whether two matrices are equal or not

Write a C program to enter elements in two matrices and check whether both matrices are equal or not. C program to check whether elements of two matrices are equal or not. Logic to check if two matrices are equal or not in C programming.

Example

Input

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

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

Output

Both matrices are equal

Read more

C program to multiply two matrices

Write a C program to read elements in two matrices and multiply them. Matrix multiplication program in C. How to multiply matrices in C. Logic to multiply two matrices in C programming.

Example

Input

Input elements of matrix1:
1 2 3
4 5 6
7 8 9
Input elements of matrix2:
9 8 7
6 5 4
3 2 1

Output

Product of matrices =
30 24 18
84 69 54
138 114 90

Read more

C program to perform Scalar matrix multiplication

Write a C program to read elements in a matrix and perform scalar multiplication of matrix. C program for scalar multiplication of matrix. How to perform scalar matrix multiplication in C programming. Logic to perform scalar matrix multiplication in C program. Example Input Input elements of matrix A: 1 2 3 4 5 6 7 … Read more