wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Mathematical Functions in Java

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

This function returns the maximum of 2 numbers

a)

Math.min()

b)

Math.max()

c)

Math.minmax()

2.

All mathematical functions are included in a class called

a)

Math

b)

System

c)

Scanner

3.

Math class is a part of Java.________ package

a)

io

b)

util

c)

lang

4.

what will be the output of Math.sqrt(-4.0)

a)

2

b)

-2

c)

NaN

5.

What will be the return value of Math.pow(2.0,3.0)

a)

8.0

b)

8

c)

NaN

6.

The return value of Math.cbrt(-15.625) is

a)

2.5

b)

-2.5

c)

NaN

7.

__________ function returns the magnitude of the number without the sign

a)

Math.round

b)

Math.floor

c)

Math.abs

8.

The return data type for the Math.round() is________

a)

float

b)

integer

c)

double

9.

The return value for Math.round(-51.2) is

a)

-51

b)

-50

c)

-52

10.

Math.ceil() will always return _____ data type

a)

integer

b)

float

c)

double

11.

The output of the function Math.ceil(-31.987)

a)

-31.0

b)

-32.0

c)

-30.0

12.

The output of Math.floor(36.987) is

a)

36

b)

37

c)

35

13.

The output of the function Math.floor(-0.9)

a)

1

b)

0

c)

-1

14.

This functions returns a random number between 0 and 1

a)

Math.round()

b)

Math.random()

c)

Math.intrandom()

15.

Math.max(-43,-41) will return

a)

-43

b)

-41

c)

NaN