226k views
4 votes
Which of the following evaluates to the variable x rounded to two decimal places?

A. round(x, 2)
B. round(2, x)
C. round(x), 2
D. round(2), x

User Hiryu
by
7.5k points

1 Answer

1 vote

Answer:

A. round(x, 2)

Step-by-step explanation:

It depends on the specific language you're using, but in most language it will follow the syntax round(x, 2).

In the first parameter you enter the value to be rounded (in this case 'x'), and in the second parameter you indicate how many decimals you want to have it rounded to (in this case '2').

Let's suppose we have number 34,54924 as x:

round(x,0) = 35

round(x,1) = 34,5

round(x,2) = 34,55

round(x,3) = 34,549

User Quicklikerabbit
by
8.0k points