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];
Comments
Leave a comment