The following code attempts to find the sum of the elements in the third column (from the left) of a two dimensional int array called a that has 10 rows and 20 columns. Correct the errors in the code.

int sum = 0;
for (int i = 0; i < 20; i++)
sum = sum + a[3][i];

The loop should be written this way:
for (int i = 0; i < 10; i++)
sum = sum + a[i][2];

Computer Science & Information Technology

You might also like to view...

You can add and remove programs by clicking Programs and Features in the Windows ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

Network upgrades have been completed and the WINS server was shutdown. It was decided that NetBIOS network traffic will no longer be permitted. Which of the following will accomplish this objective?

A. Content filtering B. Port filtering C. MAC filtering D. IP filtering

Computer Science & Information Technology