Answered Questions

  • Write a program in C to find the 3*3 matrix multiplication

    Neha

    • Mar 26th, 2018

    Q~Program to perform matrix multiplication of 3×3 using strassens algorithm. Calculate total number of addition and multiplication operation while computing the matrix multiplication

    Subhanjan Basu

    • Apr 10th, 2012

    Check this out:

    Code
    1. int a[3][3],b[3][3],c[3][3];
    2.  
    3.         int i,j,k;
    4.        
    5.         printf("enter the elements in A matrix:
    6. ");
    7.         for(i=0;i<=2;i++)
    8.         {
    9.                 for(j=0;j<=2;j++)
    10.                 {
    11.                         scanf("%d",&a[i][j]);
    12.                 }
    13.         }
    14.  
    15.         printf("enter b matrix:
    16. ");
    17.         for(i=0;i<=2;i++)
    18.         {
    19.                 for(j=0;j<=2;j++)
    20.                 {
    21.                         scanf("%d",&b[i][j]);
    22.                 }
    23.         }
    24.  
    25.        
    26.         for(i=0;i<=2;i++)
    27.         {                    
    28.        
    29.                 printf("
    30. ");
    31.                 for(j=0;j<=2;j++)
    32.                 {
    33.        
    34.                         c[i][j]=0;
    35.                         for(k=0;k<=2;k++)
    36.                         {
    37.                                  c[i][j] = c[i][j]+a[i][k] * b[k][j];
    38.                         }
    39.                 }
    40.         }
    41.         printf("multiplication matrix is:
    42. ");
    43.         for(i=0;i<=2;i++)
    44.         {
    45.                 for(j=0;j<=2;j++)
    46.                 {
    47.                         printf("%d      ",c[i][j]);
    48.                 }
    49.                 printf("
    50. ");
    51.         }