Computer Science, asked by ashrafkhan7796, 1 year ago

The advantage of for...next loops over do...loops is that they are

Answers

Answered by aarvikhan2
9
Actually these are all loops to be used in different situations. 

There are no considerable performance diffrence between these. All when compiled achieves almost same form. But some common strategical used are described below. No need to adhere to these u can use whichever u think appropriate for situation and moreover code must be easily understanadable 

For Next loops are used when u know the limits of iterating variable and iterating variable is a numeric value 

Do While 

eg Do While Not EOF 
Load(<some data>) to GridView 
Loop 

Do Until are usually used to achieve a target. 

eg Do Until Not EOF 
find(<something>) 
Loop
Answered by phillipinestest
2

"There is no clear reference has been mentioned in the question. On  assuming that the question has been asked in reference to visual basic . net. So, the answer to the given question in reference to visual basic . net is as follows:

The advantage of For Next loops over Do Loops is that they are easier to read and maintain. Moreover, they are "less prone" to being "infinite loops" and to top that up, they are "good" for "working with arrays"."

Similar questions