9.How do you round the number 7.25, to the nearest whole number?

  1. Math.round(7.25)

  2. round(7.25)

  3. rnd(7.25)

  4. Math.rnd(7.25)


Correct Option: A

AI Explanation

To round a number to the nearest whole number, you can use the Math.round() function.

Option A) Math.round(7.25) - This option is correct because the Math.round() function returns the value of a number rounded to the nearest integer. In this case, 7.25 will be rounded to 7, which is the nearest whole number.

Option B) round(7.25) - This option is incorrect because there is no standalone round() function in JavaScript. You need to use the Math.round() function.

Option C) rnd(7.25) - This option is incorrect because there is no rnd() function in JavaScript. You need to use the Math.round() function.

Option D) Math.rnd(7.25) - This option is incorrect because there is no Math.rnd() function in JavaScript. You need to use the Math.round() function.

The correct answer is Option A) Math.round(7.25) because it correctly rounds the number 7.25 to the nearest whole number.

Find more quizzes: