Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #define n 3
- #define m 2
- int main()
- {
- int pcarro[n][m], pmodelo[m][n],i,j,k,pmatriz[3][3]={0};
- for(i=0;i<n;i++)
- for(j=0;j<m;j++)
- {
- printf("pcarro[%d][%d]",i+1,j+1);
- scanf("%d", &pcarro[n][m]);
- }
- for(i=0;i<m;i++)
- for(j=0;j<n;j++)
- {
- printf("pmodelo[%d][%d]",i+1,j+1);
- scanf("%d", &pmodelo[m][n]);
- }
- for(i=0;i<n;i++)
- for(j=0;j<n;j++)
- for(k=0;k<m;k++)
- {
- pmatriz[i][j]+=pcarro[i][k]*pmodelo[k][j];
- }
- system("cls");
- for(i=0;i<3;i++){
- printf("|");
- for(j=0;j<3;j++)
- printf("%6d",pmatriz[i][j]);
- printf("|\n");
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment