Answers for "kotlin loop on range"

1

kotlin when range

fun main(args : Array<String>){ 
  
    println("Integer range:") 
    // creating integer range  
    for(num in 1..5){ 
        println(num) 
    } 
}
Posted by: Guest on February-27-2021
-1

kotlin when range

In Kotlin, the range is a collection of finite values which is defined by endpoints. The range in Kotlin consists of a start, a stop, and the step. The start and stop are inclusive in the Range and the value of step is by default 1. The range is used with comparable types.
Posted by: Guest on February-27-2021

Browse Popular Code Answers by Language