Implementing a number range check in code

Report a typo

Your task is to fill the blanks in the given Kotlin code. The goal of the code is to check if a number falls within a certain range and then output a message based on that checking. Your job is to define the range of numbers and use the correct relational operator to perform the check. Remember, the range can be any sequence of numbers you want, and the relational operator should correctly assess whether a number falls within that range.

Fill in the gaps with the relevant elements
fun main() {
    val  = 
    val number = 3
    val output = if (number  range) "$number is in the range." else "$number is not in the range."
    println(output)
}
rangein1..5
___

Create a free account to access the full topic