it is very easy to do 2x2 and 3x3 matrix multiplications. but how to do mxm or pxq matrix multiplications using Strassen algorithm....

tried some thing... but stuck middle.. not working

still trying.. posted this because thought someone will help for me...

expected output
Code:
Enter the number of rows and columns of first matrix: 3 3
Enter the number of rows and columns of second matrix: 3 3


Enter the elements of first matrix: 1 2 3 4 5 6 7 8 9
Enter the elements of second matrix: 1 2 3 4 5 6 7 8 9

Matrix Multiplication:
30 36 42
66 81 96
102 126 150
CODE
Code:
#include<stdio.h>
int main(){
  int a[10][10],b[10][10],c[10][10],i,j,m,n,o,p;
  int m1,m2,m3,m4,m5,m6,m7;

 printf("\nEnter the row and column of first matrix");
  scanf("%d %d",&m,&n);
  printf("\nEnter the row and column of second matrix");
  scanf("%d %d",&o,&p);

  printf("Enter the elements of first matrix: ");
  for(i=0;i<m;i++)
      for(j=0;j<n;j++)
           scanf("%d",&a[i][j]);

  printf("Enter the elements of second matrix: ");
  for(i=0;i<o;i++)
      for(j=0;j<p;j++)
           scanf("%d",&b[i][j]);    

// STUCK AT THIS PART 

  m1= (a[0][0] + a[1][1])*(b[0][0]+b[1][1]);
  m2= (a[1][0]+a[1][1])*b[0][0];
  m3= a[0][0]*(b[0][1]-b[1][1]);
  m4= a[1][1]*(b[1][0]-b[0][0]);
  m5= (a[0][0]+a[0][1])*b[1][1];
  m6= (a[1][0]-a[0][0])*(b[0][0]+b[0][1]);
  m7= (a[0][1]-a[1][1])*(b[1][0]+b[1][1]);

  c[0][0]=m1+m4-m5+m7;
  c[0][1]=m3+m5;
  c[1][0]=m2+m4;
  c[1][1]=m1-m2+m3+m6;

   printf("\nAfter multiplication using \n");
   for(i=0;i<2;i++){
      printf("\n");
      for(j=0;j<2;j++)
           printf("%d\t",c[i][j]);
   }

   return 0;
}
can you get me some C-Program which helps to do MxN Matrix Multiplication Strassen algorithm..

my code is only doing for 2x2.. but i want it to ask users for the number of columns and rows and do the multiplication...