salam 3alekom
i want to make a code to multiply two matrices
i think the algorithm is right(but if it was wrong tell me plz)
but the problem that when i want to pass a matrix to apublic function that i made (not static ) it gives me a n error can anyone tell me why that ?
this is the code :
public class Class1
{
public static void main ()
{
int[,] ahmed={ {1,2}, {1,5}};
//the first matrix
int[,] nageeb={ {1,5}, {5,9}};
//the second one
mohamed( ahmed, nageeb);
//here the compiler gives me an error
}
public void mohamed(int[,] a , int[,] B)
{
int[,] c;
for(int k=0;k<2;k++)
{
for(int l=0;l<2;l++)
{
for(int i=0;i<2;i++)
{
c[l,k]+=(a[l,i])*(b[i,k]);
}
}
System.Console.WriteLine(c[l,k]);
}
}
}
شكرا
}