)What will be the output of the following System.out.println(Math.sqrt(-16));
Answers
Answered by
1
Answer:FOUR (4)
The square root of 16 is 4.
Math.sqrt(16) = 4
see watch...
import java.io.*;
import java .math.*;
class SquareRoot
{
public static void main(String args[])
{
double x=-1;
while (x<0)
{
System.out.print(" Input the positive number :>");
String inbuff = System.console().readLine();
x = Double.parseDouble(inbuff);
}
System.out.println(" The square root of " + x + " is " + Math.sqrt(x));
}
}
Explanation:
Answered by
0
Duds chi be Chhibber was my time of
Similar questions