Online Java Compiler By
JavaTpoint.com
public class SqrtExample2 { public static void main(String[] args) { double x = -81.78; // Input negative value, Output NaN System.out.println(Math.sqrt(x)); } }
Output