Okay, So as the title says I need help finding a simple way of adding two arrays together. This is my code so far:
static void Main()
{
Console.Write("Enter Rows: ");
int row = Convert.ToInt32(Console.ReadLine());
Console.Write("Enter Columns: ");
int col = Convert.ToInt32(Console.ReadLine());
int[,] a = new int[row, col];
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
Console.Write("Enter Matrix({0},{1}): ", i, j);
a[i, j] = Convert.ToInt32(Console.ReadLine());
}
}
int[,] b = new int[row, col];
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
Console.Write("Enter Matrix({0},{1}): ", i, j);
a[i, j] = Convert.ToInt32(Console.ReadLine());
}
}
So, how would I add these two array together, and print out the result. Thanks.
bat all... I suspect you meant to in the second loop.matrix addition.int[,] b = new int[row, col];) you are setting the values toa. It seems it must beb