What will be the output of the program?
System.out.println(Math.sqrt(-4D));
Answer: Option D
Explanation:
It is not possible in regular mathematics to get a value for the square-root of a negative number therefore a NaN will be returned because the code is valid.
© 2008-2013 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy Contact us: info@indiabix.com Follow us on twitter!