fun main(args:Array<String>) { var counter =0 while (counter<=5) { println("counting ...$counter") counter++ // counter counter+1 } println("out of loop") }
- counting ...0
- counting ...1
- counting ...2
- counting ...3
- counting ...4
- counting ...5
- out of loop
0 comments:
Post a Comment