Square root

Report a typo

Now you know that kotlin.math groups multiple functions; one of them is sqrt, that calculates the square root of passed value.

Call sqrt function in the same way as we called the abs, calculate the square root of the number and print the resulting value.

Sample Input 1:

4

Sample Output 1:

2.0

Sample Input 2:

16

Sample Output 2:

4.0
Write a program in Kotlin
import kotlin.math.sqrt

fun main() {
// do not change this code
val number = readln().toDouble()

// write your code below
}
___

Create a free account to access the full topic