Question:medium

In JavaScript, the value returned by Math.ceil(3.14) will be:

Show Hint

Remember: ceil stands for ceiling (going up to the roof), floor means going down to the ground, and round means taking the closest path.
Updated On: Jul 31, 2026
  • 3
  • 3.14
  • 4
  • 2
Show Solution

The Correct Option is C

Solution and Explanation

To solve the given problem, we need to understand the functionality of the Math.ceil() method in JavaScript.

The Math.ceil() function is a built-in JavaScript method that returns the smallest integer greater than or equal to a given number. It effectively rounds a number up to the nearest whole number.

  1. We have the expression Math.ceil(3.14).
  2. The number 3.14 is a decimal number. We need to determine the smallest integer that is greater than 3.14.
  3. The integer immediately greater than 3.14 is 4.

Therefore, the value returned by Math.ceil(3.14) is 4.

Now, let's evaluate each of the options to confirm the correct answer:

  • Option 1: 3 - This is incorrect because 3 is less than 3.14, not greater.
  • Option 2: 3.14 - This is incorrect as Math.ceil() returns an integer and rounds up, not itself.
  • Option 3: 4 - This is the correct answer, as explained.
  • Option 4: 2 - This is incorrect because 2 is less than 3.14.

Thus, the correct answer is indeed 4.

Was this answer helpful?
0