Solved

The Following Code Accomplishes Which of the Tasks Written Below

Question 69

Multiple Choice

The following code accomplishes which of the tasks written below? Assume list is an int array that stores positive int values only.
Int foo = 0;
For (int j =0 ; j < list.length; j++)
If (list[j] > foo) foo = list[j];


A) It stores the smallest value in list (the minimum) in foo
B) It stores the largest value in list (the maximum) in foo
C) It stores every value in list, one at a time, in foo, until the loop terminates
D) It counts the number of elements in list that are greater than foo
E) It counts the number of elements in list that are less than foo

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions