PHP Operators
- What will be the output of the following PHP code ?
<?php
$n = 15;
$n = $n + 12;
echo $n++;
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
Operator precedence followed,incremented after display.
- What will be the output of the following PHP code ?
<?php
$num = 20;
$num = $num++ + 25;
echo $num;
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Operator precedence followed.
- What will be the output of the following PHP code ?
<?php
$num = 10;
$num = ($num + 15)++;
echo $num;
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Operator ++ can be done only on variables.
- What will be the output of the following PHP code ?
<?php
$num = 10 + ++15;
echo $num;
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Operator ++ can be done only on variables.
- What will be the output of the following PHP code ?
<?php
echo 6 * 10 / 4 + 10;
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Operator precedence order must be followed.