DEV Community

sunj
sunj

Posted on

Kotlin for과 while, 2024-03-18

var sum : Int = 0
for ( i in 1...100 ){
    sum+= i
}
println(sum)
Enter fullscreen mode Exit fullscreen mode
var index = 0
while(index<10){
   println("current index : ${index}")
   index++
}
Enter fullscreen mode Exit fullscreen mode

참조 : 유투브 강의 Code with Joyce

Top comments (0)