program
-
/* Program for multiplication of two matrices */ # include <stdio.h> # include <conio.h> # define ROW 3 # define COL 3 void main() { int mat1[ROW][COL],mat2[ROW][COL],mat3[ROW][COL]; int i,j,k; clrscr(); printf("\n Enter matrix mat1(%dx%d)row-wise:\n ",ROW,COL); for(i=0;i<ROW;i++) { for(j=0;j<COL;j++) { scanf("%d",&mat1[i][j]); } printf("\n Matrix 1 is %d \n",mat1[i][j]); printf("\n Enter matrix mat2(%dx%d)row-wise:\n ",ROW,COL); for(i=0;i<ROW;i++) { for(j=0;j<COL;j++) scanf("%d",&mat2[i][j]); } printf("\n Matrix 2 is %d \n",mat2[i][j]); } //Multiplication for(i=0;i<ROW;i++) for(j=0;j<COL;j++) { mat3[i][j]=0; for(k=0;k<COL;k++) mat3[i][j]+=mat3[i][j]+mat1[i][k] * mat2[k][j]; } // End of multiplication printf("\n The Resultant matrix mat3 is: \n"); for(i=0;i<ROW;i++) for(j=0;j<COL;j++) printf("\n %d",mat3[i][j]); printf("\n"); getch(); } main yeh program ka code run kara raha hoo par ismein kuch logical error hai jo main remove nahi kar paa raha hoo.plzzzzzzzz help me..
-
/* Program for multiplication of two matrices */ # include <stdio.h> # include <conio.h> # define ROW 3 # define COL 3 void main() { int mat1[ROW][COL],mat2[ROW][COL],mat3[ROW][COL]; int i,j,k; clrscr(); printf("\n Enter matrix mat1(%dx%d)row-wise:\n ",ROW,COL); for(i=0;i<ROW;i++) { for(j=0;j<COL;j++) { scanf("%d",&mat1[i][j]); } printf("\n Matrix 1 is %d \n",mat1[i][j]); printf("\n Enter matrix mat2(%dx%d)row-wise:\n ",ROW,COL); for(i=0;i<ROW;i++) { for(j=0;j<COL;j++) scanf("%d",&mat2[i][j]); } printf("\n Matrix 2 is %d \n",mat2[i][j]); } //Multiplication for(i=0;i<ROW;i++) for(j=0;j<COL;j++) { mat3[i][j]=0; for(k=0;k<COL;k++) mat3[i][j]+=mat3[i][j]+mat1[i][k] * mat2[k][j]; } // End of multiplication printf("\n The Resultant matrix mat3 is: \n"); for(i=0;i<ROW;i++) for(j=0;j<COL;j++) printf("\n %d",mat3[i][j]); printf("\n"); getch(); } main yeh program ka code run kara raha hoo par ismein kuch logical error hai jo main remove nahi kar paa raha hoo.plzzzzzzzz help me..
ok, what's the question ? you have compilation errors ? logic errors ? did you run this with the debugger ? did you try using a pen and paper to simulate your algorithm ?
This signature was proudly tested on animals.
-
/* Program for multiplication of two matrices */ # include <stdio.h> # include <conio.h> # define ROW 3 # define COL 3 void main() { int mat1[ROW][COL],mat2[ROW][COL],mat3[ROW][COL]; int i,j,k; clrscr(); printf("\n Enter matrix mat1(%dx%d)row-wise:\n ",ROW,COL); for(i=0;i<ROW;i++) { for(j=0;j<COL;j++) { scanf("%d",&mat1[i][j]); } printf("\n Matrix 1 is %d \n",mat1[i][j]); printf("\n Enter matrix mat2(%dx%d)row-wise:\n ",ROW,COL); for(i=0;i<ROW;i++) { for(j=0;j<COL;j++) scanf("%d",&mat2[i][j]); } printf("\n Matrix 2 is %d \n",mat2[i][j]); } //Multiplication for(i=0;i<ROW;i++) for(j=0;j<COL;j++) { mat3[i][j]=0; for(k=0;k<COL;k++) mat3[i][j]+=mat3[i][j]+mat1[i][k] * mat2[k][j]; } // End of multiplication printf("\n The Resultant matrix mat3 is: \n"); for(i=0;i<ROW;i++) for(j=0;j<COL;j++) printf("\n %d",mat3[i][j]); printf("\n"); getch(); } main yeh program ka code run kara raha hoo par ismein kuch logical error hai jo main remove nahi kar paa raha hoo.plzzzzzzzz help me..
-
/* Program for multiplication of two matrices */ # include <stdio.h> # include <conio.h> # define ROW 3 # define COL 3 void main() { int mat1[ROW][COL],mat2[ROW][COL],mat3[ROW][COL]; int i,j,k; clrscr(); printf("\n Enter matrix mat1(%dx%d)row-wise:\n ",ROW,COL); for(i=0;i<ROW;i++) { for(j=0;j<COL;j++) { scanf("%d",&mat1[i][j]); } printf("\n Matrix 1 is %d \n",mat1[i][j]); printf("\n Enter matrix mat2(%dx%d)row-wise:\n ",ROW,COL); for(i=0;i<ROW;i++) { for(j=0;j<COL;j++) scanf("%d",&mat2[i][j]); } printf("\n Matrix 2 is %d \n",mat2[i][j]); } //Multiplication for(i=0;i<ROW;i++) for(j=0;j<COL;j++) { mat3[i][j]=0; for(k=0;k<COL;k++) mat3[i][j]+=mat3[i][j]+mat1[i][k] * mat2[k][j]; } // End of multiplication printf("\n The Resultant matrix mat3 is: \n"); for(i=0;i<ROW;i++) for(j=0;j<COL;j++) printf("\n %d",mat3[i][j]); printf("\n"); getch(); } main yeh program ka code run kara raha hoo par ismein kuch logical error hai jo main remove nahi kar paa raha hoo.plzzzzzzzz help me..