Code:
<?php
$r = 4;
$d = NULL;
$c = NULL;
$a = NULL;
// $r = radius
// $d = diameter
// $c = circumference
// $a = area
/* formulas for the area, diameter and circumference of circle */
$d = 2 * $r;
$c = 2 * 3.14 * $r;
$a = 3.14 * ($r * $r);
echo "When the radius of circle is 4:";
echo "<br>";
echo "<br>";
echo "\n Diameter of Circle = " . $d . " units" ;
echo "<br>";
echo "\nCircumference of circle = " . $c . " units";
echo "<br>";
echo "\nArea of Circle = " . $a . " sq. units";
?>
Output:
The Tech Platform
Comments