

In this following program, we will use Do-while Loop to print numbers from 1 to n. Do-while Loop Example – Print numbers from 1 to N In this following program, we will use While Loop to print numbers from 1 to n.Ĥ 3. While Loop Example – Print numbers from 1 to N Var daysOfWeek = listOf("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday") In the following program, for loop is used to print each item of a list. For Loop Example – Iterate over elements of a list

In the following, we cover examples for each of the looping statements, break and continue statements. The following tutorials cover some of the special use cases with loop statements. Kotlin also provides some statements to break or continue the above loops. The following tutorials explain looping statements in detail with syntax and a good range of examples.
