keepkoding

Matrix a = [1, 1, 1] [4, 5, 6] [1, 2, 3] matrix b = [1, 1, 1] [-2, 3, 1] [1, 0, 1]

Addition of two matrices: [2 2 2] [2 8 7] [2 2 4]

Matrix a = [4, 5, 5] [3, 0, 1] [1, 2, 3] Matrix b = [2, 0, 3] [2, 3, 1] [0, 1, 1]

Subtraction of two matrices: [2 5 2] [1 -3 0] [1 1 2]

[1, 0, 0] [0, 1, 0] [0, 0, 1]

MATRIX IS AN IDENTITY MATRIX

Matrix = [4, 0, 0] [0, 5, 0] [0, 0, 6]

MATRIX IS AN SPARSE MATRIX

Matrix = [9, 8, 7] [6, 5, 4] [3, 2, 1]

LOWER TRIANGULAR MATRIX [9, 0, 0] [6, 5, 0] [3, 2, 1]

UPPER TRIANGULAR MATRIX [9, 8, 7] [0, 5, 4] [0, 0, 1]

EVEN NUMBER IN MATRIX 8 6 4 2

ODD NUMBER IN MATRIX 9 7 5 3 1

Frequency of even number in matrix:4

Frequency of odd number in matrix:5

Frequency of odd number in matrix:5 Frequency of even number in matrix:4

Matrix A = [9, 8, 7] [6, 5, 4] [3, 2, 1] Matrix B = [1, 2, 3] [4, 5, 6] [7, 8, 9]

PRODUCT OF TWO MATRICES 90 114 138 54 69 84 18 24 30

SUM OF ALL NUMBER IN THE MATRIX:45

SUM OF EACH ROW IN THE MATRIX 24 15 6

SUM OF EACH COLUMN IN THE MATRIX 18 15 12

TRANSPOSE [9, 6, 3] [8, 5, 2] [7, 4, 1]

Matrix = [3, -2, 4] [-2, 6, 2] [4, 2, 3]

TRANSPOSE: [3, -2, 4] [-2, 6, 2] [4, 2, 3] THE MATRIX IS SYMMETRIC MATRIX

Matrix = [1,0,0] [0,1,0] [0,0,1]

TRANSPOSE: [1,0,0] [0,1,0] [0,0,1] PRODUCT OF TRANSPOSE MATRIX AND ORIGINAL MATRIX: [1,0,0] [0,1,0] [0,0,1] MATRIX IS ORTHOGONAL MATRIX

DIAGONALS OF MATRIX 9 7 5 3 1

ELEMENTS NOT ON DIAGONALS OF MATRIX 8 6 4 2

SUM OF DIAGONAL MATRIX:25

BOUNDARY ELEMENTS OF MATRIX 9 8 7 6 4 3 2 1

NON-BOUNDARY ELEMENTS OF MATRIX 5

SUM OF NON-DIAGONAL ELEMENTS OF MATRIX:20

SUM OF BOUNDARY ELEMENTS OF MATRIX:40

SUM OF NON-BOUNDARY ELEMENTS OF MATRIX:5

LARGEST ELEMENT OF MATRIX:9

SMALLEST ELEMENT OF MATRIX:1

LARGEST ELEMENT IN DIAGONALS OF MATRIX:9

SMALLEST ELEMENT IN DIAGONALS OF MATRIX:1

LARGEST ELEMENT IN BOUNDARY ELEMENT OF MATRIX:9

SMALLEST ELEMENT IN BOUNDARY ELEMENT OF MATRIX:1

Matrix = [5, 2, 7] [9, 6, 4] [3, 8, 1]

SORTED MATRIX 1 2 3 4 5 6 7 8 9

SORTED MATRIX 9 8 7 6 5 4 3 2 1

SORTED MATRIX 1 2 3 4 6 5 7 8 9

SORTED MATRIX 9 8 7 5 6 4 3 2 1

Matrix = [5, 2, 9, 8, 7] [9, 6, 4, 2, 3] [3, 8, 1, 3, 9] [1, 2, 3, 4, 5]

SORTED MATRIX [5, 2, 9, 8, 7] [9, 1, 2, 3, 3] [3, 4, 6, 8, 9] [1, 2, 3, 4, 5]

SORTED MATRIX [5, 2, 9, 8, 7] [9, 8, 6, 4, 3] [3, 3, 2, 1, 9] [1, 2, 3, 4, 5]

Matrix [1, 2, 3] [4, 5, 6] [7, 8, 9]

spiral 1 2 3 6 9 8 7 4 5

spiral 1 4 7 8 9 6 3 2 5

Matrix [3, 20, 1] [13, 5, 4] [9, 19, 7]

SORTED MATRIX 1 3 20 4 5 13 7 9 19

SORTED MATRIX 20 3 1 13 5 4 19 9 7

SORTED MATRIX 3 5 1 9 19 4 13 20 7

SORTED MATRIX 13 20 7 9 19 4 3 5 1

ENTER THE ROW 3 ENTER THE COLUMN 3 ENTER THE ELEMENTS IN ARRAY 1 2 3 4 5 6 1 7 8 ENTER THE ELEMENT TO BE SEARCHED 1 SEARCHED ELEMENT FOUND row:1 column1 SEARCHED ELEMENT FOUND row:3 column1

OUTPUT: Enter Number of rows: 4 Enter Number of columns: 4 Enter Elements in Array: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Original Array: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Array After Cycling row : 13 14 15 16 1 2 3 4 5 6 7 8 9 10 11 12

OUTPUT: Enter Number of rows: 4 Enter Number of columns: 4 Enter Elements in Array: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Original Array: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Array after swapping first and last row: 13 14 15 16 5 6 7 8 9 10 11 12 1 2 3 4

Enter size of array: 4 Enter Elements in Array: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Original Matrix: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Elements Below the Left diagonal of Matrix: 5 9 10 13 14 15

Enter size of Matrix: 4 Enter Elements in Matrix: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Original Matrix: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 elements Below right Diagonal Matrix: 8 11 12 14 15 16

Enter size of Matrix: 4 Enter Elements in Matrix: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Original Matrix: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Elements Above right Diagonal Matrix: 1 2 3 5 6 9

Enter Row size of 1st matrix: 2 Enter Column size of 1st matrix: 3 Enter Row size of 2nd matrix: 3 Enter Column size of 2nd matrix: 4 Enter Elements in First Matrix: 1 2 3 4 5 6 Enter Elements in Second Matrix: 1 2 3 4 5 6 7 8 9 10 11 12 Matrix 1: 1 2 3 4 5 6 Matrix 2: 1 2 3 4 5 6 7 8 9 10 11 12 Matrix 1 * Matrix 2: 38 44 50 56 83 98 113 128

Enter size of integer Matrix: 4 Enter Elements in Matrix: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Elements in Matrix: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 The product of elements of row 1 is=24 The product of elements of row 2 is=1680 The product of elements of row 3 is=11880 The product of elements of row 4 is=43680 The product of elements of Column 1 is=585 The product of elements of Column 2 is=1680 The product of elements of Column 3 is=3465 The product of elements of Column 4 is=6144

Enter size of integer matrix: 4 Enter Elements in matrix: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Elements in matrix: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 The Largest value of row 1 is=4 The Largest value of row 2 is=8 The Largest value of row 3 is=12 The Largest value of row 4 is=16

Enter size of integer matrix: 4 Enter Elements in matrix: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Elements in matrix: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 The Highest value of Column 1 is=13 The Highest value of Column 2 is=14 The Highest value of Column 3 is=15 The Highest value of Column 4 is=16

Do you need help with your computer project or assignment?