Answers for "while loop kotlin"

1

kotlin while

var i = 1
while (i < 5) { 	// while loop
	println(i)
	i++
}					

var i = 1
do { 				// do-while loop
	println(i)
	i++
} while (i < 5)
Posted by: Guest on April-21-2021
7

kotlin simple for loop

val names = listOf("Jack", "John", "Tim")
for(name in names){
	println(name)
}
Posted by: Guest on February-18-2020
0

kotlin while loop

while ( isTrue() );

while ( isTrue() ) {
  println("while!")
}

do {
  println("do while!")
} while (isTrue())
Posted by: Guest on February-02-2021
0

while loop kotlin

for (item in collection) print(item)
Posted by: Guest on March-02-2020
0

while loop kotlin

var i = 1
while (i < 5) { 	// while loop
	println(i)
	i++
}					

var i = 1
do { 				// do-while loop
	println(i)
	i++
} while (i < 5)
Posted by: Guest on October-13-2021
0

while loop kotlin

fun displayForLoop() {
        for (i in 1..5)
            println(i)
    }
Posted by: Guest on October-13-2021

Browse Popular Code Answers by Language