Find The Inverse The Of Number - Java Quiz Question


Write a program to get inverse of the given number.

Input (Number) Output
2.0 0.5
30 0.03333
-15 -0.06667
0.0 null
null null



class InverseOfNumber
{
    public static void main(String s[])
    {
        Double value = 12.0;
        Double result = inverseOfNumber(value);
        System.out.println("The inverse of the given number 12.0 is "+result);

    }


        public static Double inverseOfNumber(Double value)
        {
            Double result = null;
            return result;
        }

}