QUESTION 38 What does the following section of code do? Dim intCount As Integer
ID: 3838016 • Letter: Q
Question
QUESTION 38
What does the following section of code do?
Dim intCount As Integer
Dim intXXXX As Integer = intNumbers (0)
For intCount = 1 to (inNumbers.Length -1)
If intNumbers(intCount) > intXXXX Then
intXXXX = intNumbers(intCount)
End If
Next intCount
A.Finds the first element of the array intNumbers
B.Finds the last element of the array intNumbers
C.Finds the Highest value in the array intNumbers
D.Finds the Lowest value in the array intNumbers
A.Finds the first element of the array intNumbers
B.Finds the last element of the array intNumbers
C.Finds the Highest value in the array intNumbers
D.Finds the Lowest value in the array intNumbers
Explanation / Answer
Answer C
This section finds the highest value in the array intNumbers.
Intially the first element in the array intNumbers is assinged to intXXXX.
intCount is used as the loop variable.
The loop is executed (array length - 1) times, i.e. from index 1 to (array length -1).
Each time the next value in the array is compared with the intXXXX value.
In case that value is foound greater than the intXXXX value then it will be assigned to intXXXX.
Hence this section finds the highest value in the given array.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.