wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Math_functions

Total questions: 12

Worksheet time: 4mins

Name
Class
Date
1.

Math.max(-6.43, -16.2)

a)

-16.2

b)

-6.43

c)

6.43

2.

Math.pow(3.0, 4.0)

a)

27.0

b)

81.0

c)

81

d)

64.0

3.

Math.abs(-77.87)

a)

77.80

b)

77.90

c)

-77.80

d)

77.87

4.

Math.sqrt(-16) gives

a)

4

b)

4.0

c)

256

d)

NaN

5.

Math.round(7.5) & Math.round(-7.5)

a)

8 , -7

b)

8, 8

c)

7, -8

6.

System.out.println(Math.round(6.9) + Math.round(-4.6));

a)

-2

b)

2

c)

10

d)

-10

7.

Math.rint(-3.2) & Math.rint(6.9)

a)

3.0 , 7.0

b)

-3.0 , 7.0

c)

3 , 7

d)

-3 , 7

8.

What is the value of “d” in the following Java code snippet?

double d = Math.round ( 2.5 + Math.random() );

a)

2

b)

3

c)

4

d)

3.4

9.

What will be the output of the following Java program?

class Output {

public static void main(String args[]) {

int x = 3.14;

int y = (int) Math.abs(x);

System.out.print(y);

}

}

a)

0

b)

3

c)

3.0

d)

3.1

10.

What will be the output of the following Java program?

class Output {

public static void main(String args[ ]) {

double x = 3.1; double y = 4.5;

double z = Math.max( x, y );

System.out.print(z);

}

}

a)

true

b)

false

c)

3.1

d)

4.5

11.

What will be the output of the following Java program?


class Output

{

public static void main(String args[])

{

double x = 4.0;

double y = 3.0;

double z = Math.pow( x, y );

System.out.print(z);

}

}

a)

4.0

b)

16.0

c)

64.0

d)

64

12.

NaN means

a)

Null value

b)

Negative value

c)

NaN is a term used in mathematics and computer science to describe a non-numeric value.

d)

Not applicable