Kotlin

Kotlin While Loop Example1 min read

As like In Java, Kotlin while loop continually executes a block of statements while a particular condition is true.

Test expression inside the while loop parenthesis is a Boolean expression.




If the test expression is evaluated to true then contents inside the while loop will be executed.

Process continues until the test expression is evaluated to false.

If the test expression is evaluated to false while will terminate it’s execution.

Output:

Leave a Comment