63 195
Assignments Done
99,3%
Successfully Done
In July 2018

Answer to Question #68862 in Visual Basic for Jonathan Doan

Question #68862
What is wrong with the following loop?

Dim intIndex As Integer = 10

Do While intIndex >= 10

lstBox.Items.Add("Hello")

intIndex += 2

Loop

It is an infinite loop
The test variable should not be changed within the loop itself
Nothing
It should have been written as a Do Until loop
Expert's answer
Answer:
It is an infinite loop. If you ever want to see “Hello”, replace ‘Do While intIndex >= 10’ with ‘Do While intIndex <= 10’

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions