<?php
/* define some variables */
$mean = 9;
$median = 10;
$mode = 9;
// lessthan operator
// returns true if left side is less than right
// returns true here
$result = ($mean < $median);
print “result is $result<br /> “;
// greaterthan operator
// returns true if left side is greater than right
// returns false here
$result = ($mean > $median);
print “result is $result<br /> “;
// lessthanorequalto operator
// returns true if left side is less than or equal to right
// returns false here
$result = ($median <= $mode);
print “result is $result<br /> “;
// greaterthanorequalto operator
// returns true if left side is greater than or equal to right
// returns true here
$result = ($median > = $mode);
print “result is $result<br /> “;
// equality operator
// returns true if left side is equal to right
// returns true here
$result = ($mean == $mode);
print “result is $result<br /> “;
// notequalto operator
// returns true if left side is not equal to right
// returns false here
$result = ($mean != $mode);
print “result is $result<br /> “;
// inequality operator
// returns true if left side is not equal to right
// returns false here
$result = ($mean <> $mode);
print “result is $result”;
php?>

Leave a Reply