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