Assume that an integer array named intValues contains intNUM elements. Which of the following code segments most efficiently finds the largest element in the array and displays it in a label named lblMaxValue? Assume that values have already been inserted into the array.
a. ```For intIndex = 0 To intNUM – 1
If (intValues(intIndex) > CInt(txtMax.Text)) Then
lblMaxValue.Text = intValues(intIndex).ToString
End If
Next intIndex
```
b. ```intMax = intValues(0)
For intIndex = 1 to intValues.length - 1
If intValues(intIndex) > intMax Then
intMax = intValues(intIndex)
End If
Next
lblMaxValue.text = intMax.ToString
```
c. ```For intIndex = 0 To intNUM
If intValues(intIndex) > intMax Then
intValues(intIndex) = intMax
End If
Next
lblMaxValue.Text = intMax.ToString
```
d. ```intMax = intValues(0)
For intIndex = 1 To intValues.length
If intValues(intIndex) > intMax) Then
intMax = intValues(intIndex)
lblMaxValue.Text = intMax.ToString
End If
Next
```
b. ```intMax = intValues(0)
For intIndex = 1 to intValues.length - 1
If intValues(intIndex) > intMax Then
intMax = intValues(intIndex)
End If
Next
lblMaxValue.text = intMax.ToString
```
You might also like to view...
Which command moves the cursor to the end of the current paragraph? Can you use this command to skip through the buffer in one-paragraph steps?
What will be an ideal response?
NetWare uses ____ to move data from one location to another to maintain effective use of available hard drive space.
A. data mitigation B. data harvesting C. data gathering D. data migration