Maths in Java MCQs Exercise II

Ques 1 Maths


Which of the following options correctly represents the Java 10 math function for finding the absolute value of a number?

A Math.log(x)
B Math.sqrt(x)
C Math.pow(x, 0.5)
D Math.abs(x)

Ques 2 Maths


Which of the following options correctly represents the Java 10 math function for finding the maximum value between two numbers?

A Math.max(x, y)
B Math.min(x, y)
C Math.abs(x)
D Math.pow(x, y)

Ques 3 Maths


Which of the following options correctly represents the Java 10 math function for calculating the natural logarithm of a number?

A Math.log(x)
B Math.exp(x)
C Math.pow(x, y)
D Math.abs(x)

Ques 4 Maths


Which of the following options correctly represents the Java 10 math function for generating a random number between 0 (inclusive) and 1 (exclusive)?

A Math.random()
B Math.floor(x)
C Math.ceil(x)
D Math.abs(x)