Program for Matrix operations with pointers 

 

1) Create() : for creating and reading m x n elements in the given matrix using pointers.
2) Create1() : for reading m x n elements in the given matrix without using pointers.
3) print() : diaplays the given matrix using pointers
4) Print1() : displays the given matrix without using pointers.
3) Transpose() : Creates transpose of the given square matrix using pointers.
4) addmat() : adds two matrices and returns the resultant matrix using pointers.
5) multmat() : multipiles two matrices without using pointers.
6) saddle() : checks whether the given matrix has a saddle point without using pointers.

 

 

;j++)>;j++)>;i++)>;i++)>

Output 

1)Transpose of the Matrix:(transpose stored in the same matrix)
2)Add two matrices
3)Multiply two matrices
4)Saddle point in the matrix
5)Quit
Enter Your Choice : 1

Enter the size of the matrix :3 3

Enter the data:1 2 3
4 5 6
7 8 9

Result=

1 4 7
2 5 8
3 6 9
1)Transpose of the Matrix:(transpose stored in the same matrix)
2)Add two matrices
3)Multiply two matrices
4)Saddle point in the matrix
5)Quit


Enter Your Choice : 2

Enter the size of the 1st matrix :3 3

Enter the data:1 2 3
4 5 6
7 8 9

Enter the size of the 2nd matrix :3 3

Enter the data:9 8 7
6 5 4
3 2 1

Result=

10 10 10
10 10 10
10 10 10
1)Transpose of the Matrix:(transpose stored in the same matrix)
2)Add two matrices
3)Multiply two matrices
4)Saddle point in the matrix
5)Quit
Enter Your Choice : 3

Enter the size of the 1st matrix :2 2

Enter the data:6 8
3 5

Enter the size of the 2nd matrix :2 2

Enter the data:7 9
2 4

Result=

58 86
31 47
1)Transpose of the Matrix:(transpose stored in the same matrix)
2)Add two matrices
3)Multiply two matrices
4)Saddle point in the matrix
5)Quit
Enter Your Choice : 4

Enter the size of the 1st matrix :2 2

Enter the data:5 6
1 2

Saddle point exist at (0,0) with value as 5
1)Transpose of the Matrix:(transpose stored in the same matrix)
2)Add two matrices
3)Multiply two matrices
4)Saddle point in the matrix
5)Quit
Enter Your Choice : 5