To round a number to the nearest integer, you can use the Math.round()
function.
Option A) round(7.25)
- This option is incorrect because round
is not a valid function. The correct syntax is Math.round()
.
Option B) rnd(7.25)
- This option is incorrect because rnd
is not a valid function. The correct syntax is Math.round()
.
Option C) Math.round(7.25)
- This option is correct. The Math.round()
function rounds the number to the nearest integer.
Option D) Math.rnd(7.25)
- This option is incorrect because rnd
is not a valid function. The correct syntax is Math.round()
.
The correct answer is Option C. This option is correct because it uses the Math.round()
function to round the number 7.25 to the nearest integer.