Vidyalelo
PHP · Q49

Operators And Expressions

Programming · PHP · question 49

Q49

What will be the output of the following PHP code ?

A.
4.25
B.
3.25
C.
-3.25
D.
-4.25
Answer

Answer: Option D

Solution

Answer: Option D
Solution:
First the * is evaluated then / followed by + therefore we can rewrite this expression as 4 +((- 3 * 11) / 4) which results in -4.25.