Check the given number is either positive or negative using php.


 

 
<?php
//WAP to check the given number is 
either positive or negative using php.

$a=-9;
if($a>0)
{
echo "positive".$a;

}
elseif($a==0)
{
echo "positive".$a;

}
else{
echo "negative".$a;
}
?>

 Output:-

 







No comments:

Post a Comment

theengineerschoice01@gmail.com