Answers for "find how many small in a word in kotlin kotlin"

0

find how many small in a word in kotlin kotlin

import java.util.*

class FindHowMaySmallInAWord {
    init {
        print("Enter THe Word : ")
        val read = Scanner(System.`in`)
        val inputs:String = read.next()
        var ans: Int = 0
        for (i in 0..inputs.lastIndex) {
            if (inputs[i].toString() == inputs[i].lowercase(Locale.getDefault())) {
                ans += 1
            }
        }
        println("There are $ans Small letters")
    }
}

// kotlin
Posted by: Guest on May-31-2021

Browse Popular Code Answers by Language