Created
          April 16, 2012 16:09 
        
      - 
      
- 
        Save uugr/2399699 to your computer and use it in GitHub Desktop. 
    4x4 Matrix Multiplication
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <stdio.h> | |
| int main(){ | |
| int matA[4][4]={{0,1,2,3},{4,5,6,7},{8,9,10,11},{12,13,14,15}}; | |
| int matB[4][4]={{0,1,2,3},{4,5,6,7},{8,9,10,11},{12,13,14,15}}; | |
| int matC[4][4]; | |
| int i,j,k; | |
| for (i=0;i<4;i++){ | |
| for(j=0;j<4;j++){ | |
| matC[i][j] = 0; | |
| for(k=0;k<4;k++){ | |
| matC[i][j] += matA[i][k] * matB[k][j]; | |
| } printf("%5d",matC[i][j]); | |
| } printf("\n"); | |
| } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment