Question: C# Program: PLEASE MAKE SURE YOU READ THE QUESTION BEFORE ANSWERING Numbers of Rows = 11, number of Columns = 14 Starting at index position

C# Program:

PLEASE MAKE SURE YOU READ THE QUESTION BEFORE ANSWERING

Numbers of Rows = 11, number of Columns = 14

Starting at index position (0,0) begin filling Mat6 with values starting at -7 and increasing by 1 each time as you iterate the indices over the ROWS first, then over COLUMNS second and it should write the output to files

NOTICE**** the iteration is over the ROWS FIRST and COLUMNS SECOND

I have the matrix built and then realized that how the iteration was set up. Could you modify what I have?

//Matrix [11,14], (0,0), -7, 1++

int[,] mat1 = new int[11, 14];

int rowCount = mat1.GetLength(0);

int colCount = mat1.GetLength(1);

int currCounter = -7;

Console.WriteLine("Test ");

for (int row = 0; row < rowCount; row++)

{

for (int col = 0; col < colCount; col++)

{

mat1[row, col] = currCounter++;

currCounter += 1;

Console.Write("{0} ", mat1[row, col]);

}

Console.WriteLine(" ");

}

}

I am not looking for the output of -7 -6 -5 -4 -3 -2 -1 I am looking for: -7 -6 -5 -4 -3 -2 -1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!