0

#include <stdio.h> #define MAX 50 int main() { int a[MAX][MAX], b[MAX][MAX], product[MAX][MAX]; int arows, acolumn

Answer is not show in my console Tell me what?

7th May 2021, 2:11 PM
Radha Shinde
Radha Shinde - avatar
6 odpowiedzi
+ 1
Yep the title isn't the place for code. As Martin Taylor pointed out, the code got cut off. Try to link your code in the description. Also, tags are not for arbitrary letters, they are meant to identify the subject of the question. it would be perfect to add the language you are using in those. Asking good question can give you much better help. Put more effort next time :)
7th May 2021, 2:57 PM
Apollo-Roboto
Apollo-Roboto - avatar
0
#include <stdio.h> #define MAX 50 int main() { int a[MAX][MAX], b[MAX][MAX], product[MAX][MAX]; int arows, acolumns, brows, bcolumns; int i, j, k; int sum=0; printf ("enter the row and columns of the matrix:"); scanf("%d %d", &arows, &acolumns); printf ("enter the row and columns of the matrix a:\n"); for(i=0; i<arows; i++) { for(j=0; j<bcolumns; j++) { scanf ("%d",&a[i][j]); } } printf ("enter the row and columns of the matrix b:\n"); scanf("%d %d", &brows ,&bcolumns); if(brows != acolumns ) { printf (" sry we can't multiply the matrix a&b"); } else { printf ("enter the row and columns of the matrix b:\n"); for(i=0; i<brows; i++) { for(j=0; j<bcolumns; j++) { scanf ("%d",&b[i][j]); } } } printf ("\n"); for(i=0; i<arows; i++) { for(j=0; j<acolumns; j++) { for(k=0; k<acolumns; k++) { sum += a[i][k]*b[k][j]; } product [i][j]= sum; } }
8th May 2021, 8:30 AM
Radha Shinde
Radha Shinde - avatar
0
Is this ok
8th May 2021, 8:31 AM
Radha Shinde
Radha Shinde - avatar
0
I'm not sure but I think you are missing a printf at the end of your code,which would be why you don't have an answer being shown. Also, avoid pasting your code, there is a button that allows you to link a code from the code playground. It makes it easier for us to read and try.
8th May 2021, 3:38 PM
Apollo-Roboto
Apollo-Roboto - avatar
0
Ok and thank you so much
8th May 2021, 3:39 PM
Radha Shinde
Radha Shinde - avatar