- 2

Someone can help me please, I have this program a in C, but mo compiles me, attached description of the program and the prograa

Design a C program that assigns a matrix A of 5x3, multiples of 3 and the matrix B of 5x3, multiples of 5, in. Matrix C assigns the result of the multiplication of each element of A and B. #include <stdio.h> #define FILAS_MATRIZ_B 3 #define COLUMNAS_MATRIZ_B 2 #define FILAS_MATRIZ_A 3 #define COLUMNAS_MATRIZ_A 3 int main(void) { int matrizA[FILAS_MATRIZ_A][COLUMNAS_MATRIZ_A] = { {3, 6, 9, 12,15}, {18, 21, 24,27,30}, {33 ,36, 39,42, 45}, }; int matrizB[FILAS_MATRIZ_B][COLUMNAS_MATRIZ_B] = { {5 , 10, 15, 20, 25}, {30, 35, 40, 45, 50}, {55, 60, 65, 70, 75}, }; if (COLUMNAS_MATRIZ_A != FILAS_MATRIZ_B) { printf("Columnas de matriz A deben ser igual a filas de matriz B"); return 0; } int producto[FILAS_MATRIZ_B][COLUMNAS_MATRIZ_B]; for (int a = 0; a < COLUMNAS_MATRIZ_B; a++) { for (int i = 0; i < FILAS_MATRIZ_A; i++) { int suma = 0; for (int j = 0; j < COLUMNAS_MATRIZ_A; j++) { suma += matrizA[i][j] * matrizB[j][a]; } producto[i][a] = suma; } } printf("Imprimiendo producto\n"); for

1st Sep 2021, 4:37 AM
kevin josuÚ mondragon nuñez
3 Answers
+ 1
Your question isn't complete Paste your program on code playground and share it's link to share complete code and use description section of your question to provide more detains about the problem you are facing.
1st Sep 2021, 4:59 AM
Arsenic
Arsenic - avatar
0
#include <stdio.h> #define FILAS_MATRIZ_B 3 #define COLUMNAS_MATRIZ_B 2 #define FILAS_MATRIZ_A 3 #define COLUMNAS_MATRIZ_A 3 int main(void) { int matrizA[FILAS_MATRIZ_A][COLUMNAS_MATRIZ_A] = { {3, 6, 9, 12,15}, {18, 21, 24,27,30}, {33 ,36, 39,42, 45}, }; int matrizB[FILAS_MATRIZ_B][COLUMNAS_MATRIZ_B] = { {5 , 10, 15, 20, 25}, {30, 35, 40, 45, 50}, {55, 60, 65, 70, 75}, }; if (COLUMNAS_MATRIZ_A != FILAS_MATRIZ_B) { printf("Columnas de matriz A deben ser igual a filas de matriz B"); return 0; } int producto[FILAS_MATRIZ_B][COLUMNAS_MATRIZ_B]; for (int a = 0; a < COLUMNAS_MATRIZ_B; a++) { for (int i = 0; i < FILAS_MATRIZ_A; i++) { int suma = 0; for (int j = 0; j < COLUMNAS_MATRIZ_A; j++) { suma += matrizA[i][j] * matrizB[j][a]; } producto[i][a] = suma; } } printf("Imprimiendo producto\n"); for (int i = 0; i < FILAS_MATRIZ_B; i++) { for (int j = 0; j < COLUMNAS_MATRIZ_B; j++) { printf("%d ", producto[i][j]); } printf("\n"); } } return 0; }
2nd Sep 2021, 2:08 AM
kevin josuÚ mondragon nuñez
0
This is the program, the description is the one that comes out above
2nd Sep 2021, 2:10 AM
kevin josuÚ mondragon nuñez