PHP Math functions pow

PHP exponential function returns number by finding out the exponential value.
pow(base, exponent)
We get output as base raised to the power of exponent.

Examples pow

echo pow(2,3); // ouptut 8
Using variables
$a=3;  
$b=4;
echo pow($a,$b); // output 81
We can create a square table by using for loop
for($i=1;$i<=10;$i++){
echo $i. "=".pow($i,2)."<br>";
}
Output is here
1=1
2=4
3=9
4=16
5=25
6=36
7=49
8=64
9=81
10=100

How pow is used with sqrt function to get hypotenuse of a triangle

Visitors Rating
Your Rating





Post your comments , suggestion , error , requirements etc here .




HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2019 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer