ExamVeda
Login
Home
Operators and Expressions in php
?

What will be the output of the following PHP code ?
<?php
$x = 4;
$y = -3;
$z = 11;
echo 4 + $y * $z / $x;
?>

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

Join the Discussion

No comments yet Be the first to discuss this question.