59.9k views
1 vote
Determine the exact output of the code:

$num = 3.14;

echo floor($num);

Select one:

a. 3.75

b. 3.5

c. 4

d. 3

1 Answer

6 votes

Answer:

3

Step-by-step explanation:

The function floor() is used to give the integer which is smaller than or equal to the provided decimal value.

for example:

let a=5.8

floor(a);

the function provides the value 5 (smaller than or equal to 5.8).

In the given code:

variable num assigns the number 3.14.

then, floor(3.14) gives the value 3 (smaller than or equal to 3.14).

then, the echo print the value on the screen.

Therefore, the correct answer is 3.

User Canaan Seaton
by
8.2k points

No related questions found