Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #define rows 5
- #define columns 4
- void mn_tab (int n,int m, int l, int A[][n], int B[][m], int C[][m])
- {
- int i,j,k,c;
- for(i=0; i<l; i++)
- {
- for(j=0; j<m; j++)
- {
- c=0;
- for(k=0; k<n; k++)
- {
- c=c+A[i][k]*B[k][i];
- }
- C[i][j]=c;
- }
- }
- }
- int main(void)
- {
- int t_A [2][3] = {1,2,3,4,5,6};
- int t_B [3][4] = {1,1,1,1,1,1,1,1,1,1,1,1};
- int t_C [2][4];
- mn_tab(3,4,2,t_A,t_B,t_C);
- int i,j;
- for(i=0;i<2;i++)
- {
- for(j=0;j<4;j++)
- printf("%d\t",t_C[i][j]);
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement