Q1What will be the output of the PHP code given below Marks

Q1.What will be the output of the PHP code given below Marks [0.5]

$v = 1;

$m = 2; $l = 3;

if( $l > $m > $v)

{

echo \"yes\";

}

Else {

echo \"no\";

}

Solution

The output would be : syntax error, unexpected \'>\'

multiple > symbol cannot be used in a single statment

instead if you change the expression to

if($l>$m && $m>$v)

then the output would be \"yes\"

Q1.What will be the output of the PHP code given below Marks [0.5] $v = 1; $m = 2; $l = 3; if( $l > $m > $v) { echo \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site