PHP Online Compiler
Example: PHP program to calculate the square root of a number
C
C++
C#
Java
Python
PHP
main.php
STDIN
Run
<?php // PHP program to calculate the square root of a number $n = 25; $r = NULL; // n = number // r = root // Calculate square root of number $r = (double)sqrt($n); // Output echo "Square root of " . $n . " = " . $r; ?>
Output
Clear
ADVERTISEMENTS