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
You might also like to view...
A Text field can store up to 155 characters and is used to store data such as names and addresses.
Answer the following statement true (T) or false (F)
____________________ scanning uses patterns in the blood vessels of the retina at the back of the eye.
Fill in the blank(s) with the appropriate word(s).
Validation ________ are the rules that dictate the type of data that can be entered.
Fill in the blank(s) with the appropriate word(s).
What are some of the design goals of AFF?
What will be an ideal response?