Loops

Looping statements are used to ensure that a collection of statements within a block of code repeats in execution. That is, a loop ensures that a number of statements within a program executes for a number of times. The looping constructs provided by Kotlin are the for loop, the while loop, and the do…while loop.