English

Which of the following mathematical methods returns only an integer? - Computer Applications

Advertisements
Advertisements

Question

Which of the following mathematical methods returns only an integer?

Options

  • Math.ceil(n)

  • Math.sqrt(n)

  • Math.floor(n)

  • Math.round(n)

MCQ

Solution

Math.round(n)

Explanation:

This method rounds up/down a supplied decimal value to a whole number. For example, Math.round(5.5) = 6, but Math.round(5.4) = 5.

shaalaa.com
Introduction of Mathematical Library Methods
  Is there an error in this question or solution?
2023-2024 (February) Official
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×