subject

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 text box named txtMax? Assume that values have already been inserted into the array.

a. For intIndex = 0 To intNUM – 1

If (intValues(intIndex) > CInt(txtMax. Text)) Then

txtMax. 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

txtMax. text = intMax. ToString

c. For intIndex = 0 To intNUM

If intValues(intIndex) > intMax Then

intValues(intIndex) = intMax

End If

Next

txtMax. Text = intMax. ToString

d. intMax = intValues(0)

For intIndex = 1 To intValues. length

If intValues(intIndex) > intMax) Then

intMax = intValues(intIndex)

maxText. Text = intMax. ToString

End If

Next

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:30
Jasper and samantha are in a robotics competition. the guidelines state that the robots should be able to move a 10-gram weight at least 2 meters and turn in a circle. jasper and samantha have already built the robot. which step of the design process should they follow next to decide whether their robot meets the minimum criteria for the competition?
Answers: 1
question
Computers and Technology, 22.06.2019 10:40
When running anti-virus software , what could be a reason where recipitent is not guaranteed that data being streamed will not get interrupted?
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
The "instance" relationship shows that something is an object of a
Answers: 1
question
Computers and Technology, 22.06.2019 23:00
Which type of tab stop is most for weights and measurements?
Answers: 1
You know the right answer?
Assume that an integer array named intValues contains intNUM elements. Which of the following code s...
Questions
question
Chemistry, 19.08.2019 09:50
question
Mathematics, 19.08.2019 09:50
question
Mathematics, 19.08.2019 09:50
Questions on the website: 13722361