According to the given question, sales is a two-dimensional array and contains 10 rows and 7 columns wherein each component is of type integer and the variables sum and j are also of integer type.
Step-by-step explanation:
In order to find the sum of the elements of the fifth row of sales, the correct piece of code should be:
sum=0;
for(j=0;j<7;j++)
sum=sum+sales[4][j];
The indexing in an array always starts from zero, therefore, to calculate the sum of the fifth row, the user has to write 4 in the index to point to the fifth row.