Write a COMPLETE and an EFFICIENT C Program in which take the values (may contain float values) of three matrices mat1(order 3x2), mat2 (order 3x2), and mat3 (order 2x5) from the user. Your code should add mat1 and mat2 and store the result in mat4 (of appropriate order) and display it. Then multiply mat4xmat3 and store the result in mat5 (of appropriate order) and display it. Finally, check whether mat5 is a sparse matrix or not? and display the decision. Note: A sparse matrix is a matrix in which most of the elements are zero. e.g. If the order of a matrix is 3x5, it means total 15 values. If atleast more than half (i.e. 18 values) are zeros (at any location), then it is a sparse matrix.
0 Comments