note 118691 deleted from control-structures.if by peehaa
| From: | peehaa@php.net | Date: | Wed, 12 Oct 2016 13:09:55 +0000 |
| Subject: | note 118691 deleted from control-structures.if by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-206849@lists.php.net to get a copy of this message | ||
Note Submitter: betty soappiece
----
$det = $b*$b-4*$a*$c;
if ($det <0)
{
echo "bubb $a⋅x² + $b⋅x + $c = 0 does not have an
answer.";
}
elseif ($det ==0)
{
$loesung = round(-$b/(2*$a),2);
echo "blubb $a⋅x² + $b⋅x + $c = 0 does not have an
answer.";
}
elseif ($det > 0)
{
$loesung1 = round((-$b+sqrt($det))/(2*$a),2);
$loesung2 = round((-$b-sqrt($det))/(2*$a),2);
echo "blubb $a⋅x² + $b⋅x + $c = 0 does have an answer
$loesung1 and $loesung2.";
}