What will be the output of the program? public class SqrtExample { public…

PYQ RPSC Programmer 2011

What will be the output of the program?

public class SqrtExample

{

public static void main(String [] args)

{

double value = -9.0;

System.out.println( Math.sqrt(value));

}

}

  1. A.

    3

  2. B.

    -3

  3. C.

    NaN

  4. D.

    Compilation fails

Attempted by 2 students.

Sign up free to check your answer

Sign up free

Explore the full course: Rpsc Programmer

Loading lesson…