Operators and Expressions in php - PHP quiz 4

By CareerCadets

Operators and Expressions in php - PHP Online Quiz 4

Operators and Expressions in php - PHP quiz 4 is a free online quiz challenge under Operators and Expressions in php - PHP category. There are 40 free online quiz challenges available in PHP category


What will be the output of the following PHP code ?

<?php
echo 5 * 9 / 3 + 9;
?>

What will be the output of the following PHP code ?

<?php
$var1 = 0;
$var1 = ++$var1 + 5; 
echo $var1; 
?>

What will be the output of the following PHP code ?

<?php
$a  =  'a' ;
print $a * 2;
?>

What will be the output of the following PHP code ?

<?php
$i = 0;
$x = $i++; $y = ++$i;
print $x; print $y; 
?>

What will be the output of the following PHP code ?

<?php
$var1 = 0;
$var1 = $var1++ + 5; 
echo $var1; 
?>

What will be the output of the following PHP code ?

<?php
$i = 0;$j = 1;$k = 2;
print (( +  + $i + $j) >! ($j - $k));
?>

What will be the output of the following PHP code ?

<?php
$i = 2;
while (++$i)
{   
    while ($i --> 0)
        print $i;
}
?>

What will be the output of the following PHP code ?

<?php
$i = 5;
while (--$i > 0)
{   
    $i++;
    print $i;
    print "hello";
}
?>

The result of below two statements will be:

Round(2.5)
Round(-2.5)

PHP will automatically convert strings to numbers when it needs to.

Invite your friends to Operators and Expressions in php - PHP quiz 4 Quiz

gmail WhatsApp Facebook Twitter Outlook Linkedin