Java program to demonstrate the use of Math class methods
KW.java
Output
kodingwindow@kw:~$ javac KW.java
kodingwindow@kw:~$ java KW Enter the angle of function 90 ——————————————————————————————————————————— Java implementation of Math class methods ——————————————————————————————————————————— Value of sin(90.0) | 1.00 Value of cos(90.0) | 0.00 Value of atan(90) | 1.56 Value of log(2) | 0.69 Value of abs(0.9) | 0.90 Value of asin(90) | NaN Value of acos(90) | NaN Value of 2^(20) | 1048576.0 Value of e^(0) | 1.0 Value of floor(0.9)| 0.0 Value of ceil(0.9) | 1.0 Value of rint(0.9) | 1.0 Value of round(0.9)| 1 Value of max(0,1) | 1 Value of min(0,1) | 0 Square Root of 25 | 5.0 Value ceil(7.999) | 8.0 Value floor(7.99) | 7.0 Value of e Is | 2.72 Value of PI Is | 3.14 ——————————————————————————————————————————— kodingwindow@kw:~$
What Next?
Java program to demonstrate the use of constructor
Java implementation of final and static keywords
Java implementation of Scanner close method
Advertisement