Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following PHP code?
<?php
$a = 1;
$b = 2;
$c = 3;
echo ($a * (($b) – $c));
?>

What will be the output of the following PHP code?
<?php
$a = 1;
$b = 2;
$c = 3;
echo ($a * (($b) – $c));
?>
a) 1
b) -1
c) 2
d) -2

Answer: b
Explanation: The innermost bracket is evaluated first since it covers only variable B, it is as good as not using brackets, then $b- $c action will be performed.

Join The Discussion