| 1. |
What Is The Difference Between Do, Do While, And If ( ) Goto Loops? |
|
Answer» In terms of what the COMPUTER actually does, there is generally no difference. You can structure all three so that they do the same THING. When properly intended, the DO structures tend to be easier to follow. The DO WHILE structure can produce slightly more compact coding, COMBINING a straight DO with the option for some extra comparison logic. In a vector and/or parallel computer, DO's send strong HINTS to the compiler that it should be looking for ways to feed a pipeline or spread calculations over multiple PROCESSORS. In terms of what the computer actually does, there is generally no difference. You can structure all three so that they do the same thing. When properly intended, the DO structures tend to be easier to follow. The DO WHILE structure can produce slightly more compact coding, combining a straight DO with the option for some extra comparison logic. In a vector and/or parallel computer, DO's send strong hints to the compiler that it should be looking for ways to feed a pipeline or spread calculations over multiple processors. |
|