SQRT JavaScript
let number = 16
Math.sqrt(number);
//output = 4
Evil Elephant
let number = 16
Math.sqrt(number);
//output = 4
console.log(Math.sqrt(4)); // 2
console.log(Math.sqrt(9)); // 3
console.log(Math.sqrt(2)); // 1.4142135623730951
console.log(Math.sqrt(0)); // 0
console.log(Math.sqrt(-0)); // -0
console.log(Math.sqrt(-1)); // NaN
import java.lang.*;
public class MathDemo {
public static void main(String[] args) {
//what is Math.sqrt(4)?
double x = 4;
System.out.println("Math.sqrt(" + x + ")=" + Math.sqrt(x));
}
}
//the output is 2