Posts

Showing posts with the label matrix multiplication in c using functions

Matrix Program #2

Image
9. Read two matrices, first m x n and second n x t, perform multiplication operation and store result in third matrix and print it. #include<stdio.h> void main() {    int i, j,k, mat1[10][10], mat2[10][10], mat3[10][10];    int row1, col1, row2, col2,sum=0;    printf("Enter the number of Rows of Mat1 : ");    scanf("%d", &row1);    printf("Enter the number of Columns of Mat1 : ");    scanf("%d", &col1);    printf("Enter the number of Rows of Mat2 : ");    scanf("%d", &row2);    printf("Enter the number of Columns of Mat2 : ");    scanf("%d", &col2);    /* Before accepting the Elements Check if no of      columns of matrix 1 and rows of martix 2 is equal */     if(col1!=row2)      {           printf("\nOrder of two matrices is not same...