Given the following declaration:
int j;int sum;double sale[10][7];
which of the following correctly finds the sum of the elements of the fifth row of sale?
A. sum = 0;
for(j = 0; j < 7; j++) sum = sum + sale[5][j];
B. sum = 0;
for(j = 0; j < 7; j++) sum = sum + sale[4][j];
C. sum = 0;
for(j = 0; j < 10; j++) sum = sum + sale[5][j];
D. sum = 0;
for(j = 0; j < 10; j++)
sum = sum + sale[4][j];
Answer: B
Computer Science & Information Technology
You might also like to view...
Which of the following statements best describes strategic risk?
A. Risk that relates to monetary loss B. Risk that relates to adverse business decisions C. Risk that relates to a loss from failed or inadequate systems and processes D. Risk that relates to violation of laws, regulations, or policy
Computer Science & Information Technology
Which of the following log analysis techniques examines activity based on patterns?
A. Trend analysis B. Signature analysis C. Correlation analysis D. Sequencing analysis
Computer Science & Information Technology