88.5k views
1 vote
Assume that a is an array of two or more integers, and that b and c are integers.

What is the result of the following code? (2 points)
c = 0;
b = 1;
if (a.length > 0) {
c = a[0];
}
while (b < a.length){
if (a[b] < c) {
c = a[b];
}
b++;
}


b contains the highest value in the array


b contains the lowest value in the array


c contains the highest value in the array


c contains the lowest value in the array


An endless loop occurs

1 Answer

1 vote

Answer:

B contains the highest value in the array

Step-by-step explanation:

Such that the first if statement will execute and like wise the second if statement will execute thereby increasing the value of b

User Mass Dot Net
by
5.3k points