Operators and Expressions in php - PHP quiz 6

By CareerCadets

Operators and Expressions in php - PHP Online Quiz 6

Operators and Expressions in php - PHP quiz 6 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
$i = 5;
while (--$i > 0 && ++$i)
{   
    print $i;
}<
?>

What will be the output of the following PHP code ?

<?php
$a = 1; $b = 1; $d = 1;
print ++$a + ++$a+$a++; print $a++ + ++$b; print ++$d + $d++ + $a++;
?>

What will be the output of the following PHP code ?

<?php
$a = "$winner";
$b = "/$looser";
echo $a,$b;
?>

What will be the output of the following PHP code ?

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

What will be the output of the following PHP code ?

<?php
$a = 10; $b = 10;
if ($a = 5)
    $b--;
print $a;print $b--;
?>

In order to find if a variable holds an actual number or a string containing characters that can be translated into a number you can use:

PHP can automatically convert integers to floating point numbers and floating point numbers to integers.

What will be the output of the following PHP code ?

<?php
$y = 2;
if ($y-- == ++$y)
{
    echo $y;
}
?>

What will be the output of the following PHP code ?

<?php
$y = 2;
if (**$y == 4)
{
    echo $y;
}
?>

What is the output of given statement?

Print 17 % 3;

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

gmail WhatsApp Facebook Twitter Outlook Linkedin