Computer Science, asked by rexralte09, 21 hours ago

tell me the output of this

#include<stdio.h>

int main(void){

int A[10][10],B[10][10],mult[10][10];
int i, j,k, r1, c1,r2, c2;

/*mult.to matrices numb of column of the 1st
matrix should be equal to numb of the rows od 2nd matrix
i.e c1=r2 */


printf("Enter the size of matrix A:");
scanf("%d %d", &r1,&c1);

printf("Enter size of matrix B:");
scanf("%d,%d",&r2,&c2);

printf("Enter the elements of matrixA:\n");
for (i=0; i<r1; i++){
for(j=0;j<c1;j++){
printf("A[%d][%d]=",i, j);
scanf("%d", &A[i][j]);
}
}

printf(" Enter the elements of matrix B:\n");
for(i=0;i<r2; i++){
for(j=0; j<c2; j++){
printf("B[%d][%d]=",i ,j);
scanf("%d", &B[i][j]);

}
}
/*display elements of matriciesA and B*/

printf("The given matrices are:\n");
printf("Matrix A:\n");
for(i=0;i<r1; i++){
for(j=0; j<c1;j++){
printf("%d\t",A[i][j]);
}
printf("\n");
}
printf("\n");

printf("Matrix B:\n");
for(i=0; i<r2; i++){
for(j=0; i<c2; j++){
printf("%d\t",B[i][j]);
}
printf("\n");
}
/*intitializing matrix mult*/

for (i=0; i<r1;i++){
for(j=0;j<c2 ; j++){
}
}

//multipliying matrices A n B in strong mult


for (i=0; i<r1;i++){
for(j=0;j<c2 ; j++){
for(k=0;k<c1; k++){

mult[i][j] += A[i][j] *B[k][j];
}
}
}
//result
printf("\nMultiplication of Matrices A and B:\n");
for (i=0; i<r1;i++){
for(j=0;j<c2 ; j++){
printf("%d\t",mult[i][j]);
}
printf("\n");
}
return 0;
}​

Answers

Answered by nriya123
0

Answer:

question is nothing

Explanation:

question is nothing

Answered by janhaviingle908
3

Program to multiply two matrices Give two matrices, the task to multiply them. Matrices can either be square or rectangular.

Attachments:
Similar questions