Mathematical library functions

Mathematical library functions

Basics of Math Library, Rounding Functions, Trigonometric Functions, Logarithmic and Exponential Functions, Absolute Value and Random Numbers, Complex Applications, Combination of Math Functions

1 / 10

What is the result of the following code snippet?

System.out.println(Math.pow(2, 3));

2 / 10

Which of the following methods always rounds a number down to the nearest integer?

 

3 / 10

What will the following code output?

double angle = Math.PI / 4;
System.out.println(Math.sin(angle));

4 / 10

What will the following code print?

System.out.println(Math.log(Math.E));

5 / 10

Which method is used to calculate the base-10 logarithm of a number in Java?

6 / 10

What is the result of the following code snippet?

System.out.println(Math.abs(-25.5));

7 / 10

What is the range of the random number generated by Math.random()

8 / 10

What will the following code print?

double x = -2.7;
System.out.println(Math.ceil(x) + ” ” + Math.floor(x));

9 / 10

What will the following code output?

double result = Math.pow(Math.sqrt(16), 3);
System.out.println(result);

10 / 10

What is the result of this program?

System.out.println(Math.max(Math.min(10, 20), Math.min(5, 15)));

Your score is

Scroll to Top