PHP Math Functions | pow() | sqrt()

Notes:

PHP Mathematical Constants & Functions:
- To perform mathematical calculations easily PHP provides various mathematical functions and constants.

pow(value1:number,value2:number):number
- Returns the result of value1(base) raise to the power of value2 (exponent).
Ex:
echo pow(2,3); // 8
echo pow(5,2); // 25
echo pow(8,2); // 64

sqrt (value: number):number
- Returns the square root of a given value.
Ex:
echo sqrt(4); // 2
echo sqrt(9); // 3
echo sqrt(16); // 4
echo sqrt(25); // 5

Interview Questions:

1. PHP stands for ______________
a. Hypertext Preprocessor
b. Preprocessor Hypertext
c. Personal Home Processor
d. Personal Hypertext processor
Ans: a