Watch this here
Output for all the following loop code.
08-26 21:31:48.491 20988-20988/? I/System.out: 0
1
2
3
4
5
6
7
8
9
10
"for" loop is used for looping list of item using index. Also we can use for loop for
for (i in 0..10){
println(i)
}
"for" loop is used for looping list of item using index. Also we can use for loop for
(0..10).forEach{
println(it)
}
"for" loop is used for looping list of item using index. Also we can use for loop for
var i=0
while (i <= 10){
print(i)
i++
}
"for" loop is used for looping list of item using index. Also we can use for loop for
i=0
do {
print(i)
i++
}while (i <= 10)