PHP is a server scripting language, and It is a powerful tool for making interactive and dynamic Web-pages. I have used WampServer 2.2 for following excercise..
<?php
function trinary_Test($n){
$r = $n > 30
? "greater than 30 <br>"
: ($n > 20
? "greater than 20<br>"
: ($n >10
? "greater than 10<br>"
: "Input a number atleast greater than 10!"));
echo $n." : ".$r."\n";
}
trinary_Test(32);
trinary_Test(21);
trinary_Test(12);
trinary_Test(4);
?>
Result:
32 : greater than 30
21 : greater than 20
12 : greater than 10
4 : Input a number atleast greater than 10!
PHP is a server scripting language, and It is a powerful tool for making interactive and dynamic Web-pages. I have used WampServer 2.2 for following excercise..
Result:
need an explanation for this answer? contact us directly to get an explanation for this answer