Compare a loop on a variable and a loop with a condition. What are the advantages and disadvantages of each of them?
September 26, 2020 | Education
| A loop over a variable will always be executed a finite number of times, but in solving problems where the number of repetitions is unknown in advance, it is not applicable. A loop with a condition must be used carefully, you must make sure that there is no endless looping.
