Which set of statements totals the items in each row of two-dimensional array items, and displays each total?
a)
int total = 0;
for (int row = 0; row < items.Length; ++row)
{
total = 0;
for (int column = 0; column < a[row].Length; ++column)
{
total += a[row][column];
}
}
b)
int total = 0;
for (int row = 0; row < items. Length; ++row)
{
for (int column = 0; column < a[row]. Length; ++column)
{
total += a[row][column];
}
}
c)
int total = 0;
for (int row = 0; row < items. Length; ++row)
{
for (int column = 0; column < a[column].length; ++column)
{
total += a[row][column];
}
}
d)
int total = 0;
for (int row = 0; row < items. Length; ++row)
{
total = 0;
for (int column = 0; column < a[column].length; ++column)
{
total += a[row][column];
}
}
a)
int total = 0;
for (int row = 0; row < items.Length; ++row)
{
total = 0;
for (int column = 0; column < a[row].Length; ++column)
{
total += a[row][column];
}
}
You might also like to view...
Why does a stealth mode IDS need a separate network to communicate alarms and to accept management commands?
What will be an ideal response?
Using ____ technology and real-time location systems, you can install computer-tracking software on your laptop.?
A. ?global positioning system B. ?encrypting file system C. uninterruptible power supply D. ?personal identification number