Safe round

Report a typo

Here is a program that uses the round function according to this logic: if the input number is greater than or equal to 1000, it returns null, otherwise it returns the number. Do not change the round function: fix the output. It has to return 0 in null case.

Sample Input 1:

-5

Sample Output 1:

-5

Sample Input 2:

5000

Sample Output 2:

0
Write a program in Kotlin
fun main() {
val number = readln().toInt()
println(round(number))
}

// do not change function below

fun round(number: Int): Int? {
return if (number >= 1000) null else number
}
___

Create a free account to access the full topic