PHP Online Compiler
Example: PHP program to calculate the area of an equilateral triangle
C
C++
C#
Java
Python
PHP
main.php
STDIN
Run
<?php // PHP program to calculate the area of an equilateral triangle $s = 7; $a = NULL; // s = side // a = area // Calculate area of equilateral triangle $a = (sqrt(3) / 4) * ($s * $s); // Output echo "Area of the equilateral triangle = " . $a . " sq. units"; ?>
Output
Clear
ADVERTISEMENTS