Question: QUESTION 20 What does the following code do? Assume list is an array of int values. int count=0; for (int j=0; j < list.length; j++)
QUESTION 20
What does the following code do? Assume list is an array of int values.
int count=0;
for (int j=0; j < list.length; j++)
if (list[j] > 0) count++;
|
| A. | It finds the smallest value in list. |
|
| B. | It finds the largest value in list. |
|
| C. | It sorts the values in list to be in ascending order. |
|
| D. | It counts the number of positive values in list. |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
