Menu
Question Index
...

What will be the output of the following program?

public class InverseFunctions {
    public static void main(String[] args) {
        double x = 0.707;
        System.out.print(getDegrees(Math.asin(x)));
        System.out.println(" " + getDegrees(Math.acos(x)) + " " + getDegrees(Math.atan(x)));
    }
    private static double getDegrees(double val) {
        return Math.rint(Math.toDegrees(val));
    }
}


45.0 45.0 45.0
45.0 45.0 35.0
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java Math Class - java.lang.Math

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App