• Top Posts

    while lopp in Kotlin

    Example while program
    /* arula.in */

    fun main(args : Array<String>)
    {
    var a : Int = 1;

    while (a <= 10){
    println("value of a: "+a)
    a++
    }

    }

    Result :
    value of a: 1
    value of a: 2
    value of a: 3
    value of a: 4
    value of a: 5
    value of a: 6
    value of a: 7
    value of a: 8
    value of a: 9
    value of a: 10

    No comments

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728