Given the following declaration:
int j;
int sum;
float sale[10][7];
which of the following correctly finds the sum of the elements of the fifth row of sale?
1. sum = 0;
for(j = 0; j < 7; j++)
sum = sum + sale[5][j];
2. sum = 0;
for(j = 0; j < 7; j++)
sum = sum + sale[4][j];
3. sum = 0;
for(j = 0; j < 10; j++)
sum = sum + sale[5][j];
4. sum = 0;
for(j = 0; j < 10; j++)
sum = sum + sale[4][j];
2. sum = 0;
for(j = 0; j < 7; j++)
sum = sum + sale[4][j];
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++