# include# include # define row 10 # define col 10 int i, j; int row1, col1; int row2, col2; float mat1[row][col]; float mat2[row][col]; float mat_res[row][col]; void mat_mult( float mat1[row][col], int, int, float mat2[row][col], int, int, float mat_res[row][col]); void display(float mat[row][col], int, int); void input(float mat[row][col], int , int); void mat_mult( float mat1[row][col], int row1, int col1, float mat2[row][col], int row2, int col2, float mat_res[row][col]) { int i, j, k; if(col1 == row2) { printf("\n Multiplication is possible and Result is as follows\n"); for(i =0; i 1:"); scanf("%d", &row1); printf("\n Input the col of the matrix->1:"); scanf("%d", &col1); printf("\n Input data for matrix-> 1\n"); input(mat1, row1, col1); printf("\n Input the row of the matrix ->2:"); scanf("%d", &row2); printf("\n Input the col of the matrix->2:"); scanf("%d", &col2); printf("\n Input data for matrix-> 2\n"); input(mat2, row2, col2); printf("\n Entered Matrix First is as follows:\n"); display(mat1,row1,col1); printf("\n Entered Matrix Two is as follows:\n"); display(mat2,row2,col2); mat_mult(mat1 ,row1 ,col1, mat2, row2, col2, mat_res); }
C Program to Multiply Two Matrices
Next Article to Read
Among many other career blogs, Fun-The-Mentals is a different blog to help students achieve their goals.. This blog is maintained by Debashish and group. The blog is intended to bring decent and genuine information to the students of colleges and universities to help their preparation for job in the competitive world.
Add on Facebook
?
0 comments:
Post a Comment