ICSE Class 10th
20 MCQ questions on various values for Math.floor() and Math.ceil() methods of Java
1. What does the "Math.floor()" method in Java do?
a. Rounds a floating-point number to the nearest integer
b. Returns the smallest integer greater than or equal to a number
c. Returns the largest integer less than or equal to a number
d. Finds the floor value of a number
2. Which of the following statements about "Math.ceil()" is true?
a. Rounds a floating-point number to the nearest integer
b. Returns the smallest integer greater than or equal to a number
c. Returns the largest integer less than or equal to a number
d. Finds the ceiling value of a number
3. What is the result of "Math.floor(7.9)" in Java?
a. 7.0
b. 8.0
c. 7.9
d. 8
4. If "x = 5.2", what is the output of "Math.ceil(x)"?
a. 5
b. 6
c. 5.2
d. 6.0
5. What does the expression "Math.floor(-3.5)" evaluate to?
a. -4.0
b. -3.0
c. -4
d. -3
6. If "y = 9.8", what is the value of "Math.ceil(y)"?
a. 9.0
b. 10
c. 9.8
d. 10.0
7. What is the output of "Math.floor(4.0)"?
a. 4
b. 4.0
c. 5
d. 0
8. If "z = -2.3", what is the result of "Math.ceil(z)"?
a. -2
b. -3
c. -2.3
d. -3.0
9. What is the value of "Math.floor(-9.6)"?
a. -9.0
b. -10.0
c. -10
d. -9.6
10. If "a = 12.7", what is the output of "Math.ceil(a)"?
a. 12
b. 13
c. 12.0
d. 13.0
11. What is the result of "Math.floor(3.01)"?
a. 3.0
b. 3
c. 4.0
d. 3.01
12. If "b = -7.6", what is the value of "Math.ceil(b)"?
a. -7.6
b. -7
c. -8
d. -8.0
13. What does the expression "Math.floor(-2.9)" evaluate to?
a. -3
b. -2.9
c. -2
d. -3.0
14. If "c = 10.5", what is the output of "Math.ceil(c)"?
a. 10
b. 10.5
c. 11
d. 11.0
15. What is the value of "Math.floor(6.8)"?
a. 6
b. 6.0
c. 7
d. 6.8
16. If "d = 14.3", what is the result of "Math.ceil(d)"?
a. 14
b. 15
c. 14.3
d. 15.0
17. What does the expression "Math.floor(-5.7)" evaluate to?
a. -6
b. -5.7
c. -5
d. -6.0
18. If "e = 0.9", what is the output of "Math.ceil(e)"?
a. 0.9
b. 1
c. 0
d. 1.0
19. What is the result of "Math.floor(9.99)"?
a. 9.0
b. 9.99
c. 10
d. 9
20. If "f = -4.2", what is the value of "Math.ceil(f)"?
a. -4
b. -4.2
c. -5
d. -5.0
1. c. Returns the largest integer less than or equal to a number (Math.floor())
2. b. Returns the smallest integer greater than or equal to a number (Math.ceil())
3. a. 7.0
4. b. 6
5. a. -4.0
6. b. 10
7. a. 4
8. b. -3
9. b. -10.0
10. b. 13
11. a. 3.0
12. c. -8
13. a. -3
14. c. 11
15. a. 6
16. b. 15
17. a. -6
18. b. 1
19. a. 9.0
20. c. -5
Comments
Post a Comment