fork download
  1. #include <stdio.h>
  2.  
  3. void array_mul(int(*x)[2],int(*y)[2],int(*ans)[2]){
  4. printf("mul\n");
  5. for(int i=0;i<2;i++){
  6. for(int j=0;j<2;j++){
  7. ans[i][j]=0;
  8. for(int p=0;p<2;p++){
  9. ans[i][j]=ans[i][j]+x[i][p]*y[p][j];
  10. }
  11. printf("%d ",ans[i][j]);
  12. }
  13. printf("\n");
  14. }
  15. }
  16.  
  17. int main(void) {
  18. // your code goes here
  19. int x[2][2]={{1,2},{3,4}};
  20. int y[2][2]={{1,2},{3,4}};
  21. int ans[2][2]={0};
  22.  
  23. array_mul(x,y,ans);
  24.  
  25. return 0;
  26. }
  27.  
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
mul
7 10 
15 22