What is the effect of the following code fragment?

```
c = -1;
for ( int i = MAX_SIZE - 1; i >= 0; --i )
if ( list1[i] == t )
c = i;
```

a. calculates 1 less than the sum of the occurrences of the value of t in list1
b. finds the subscript of the first occurrence of the value of t in list1 (or –1 if it is not found )
c. counts the number of occurrences of –1 in list1
d. counts the number of occurrences of the value of c in list1


b. finds the subscript of the first occurrence of the value of t in list1 (or –1 if it is not found )

Computer Science & Information Technology

You might also like to view...

Which of the following statements is NOT true?

A) Radio buttons are round and check boxes are square. B) Radio buttons are often grouped together and are mutually exclusive; Check boxes are not. C) Radio buttons and check boxes both implement the ActionListener interface. D) They are all true.

Computer Science & Information Technology

Which usually contains the values or amounts?

A) V B) Y C) Z D) X

Computer Science & Information Technology

A(n) ____________________ is a unique number automatically assigned to each new record you add to a table.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

To delete a worksheet, click the sheet tab for the worksheet you want to remove. On the Home tab of the Ribbon, in the ____ group, click the arrow to the right of the Delete button, and then click Delete Sheet.

A. Workbook B. Cells C. Data D. Worksheet

Computer Science & Information Technology