DWPD:3.6: Write PHP script to demonstrate math functions.

math function in php
Lab # 3

FUNCTIONS

6. Write PHP script to demonstrate math functions.

Lab-3-6-math-functions.php

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
$n1=100;
$n2=5;
$n3=min($n1,$n2);
echo "Min is : $n3"."<br><br>";
$n1=max($n1,$n3);
echo "Max is : $n1"."<br><br>";
$n4=sqrt($n1);
echo "sqrt is : $n4"."<br><br>";
$n1=pow($n2,$n4);
echo "pow is : $n1"."<br><br>";
echo "ceil : ".ceil($n1)."<br><br>";
echo "floor : ".floor($n2)."<br><br>";
echo "round : ".round($n3.$n1)."<br><br>";
echo "abs : ".abs($n4);

?>


Output

maths function in php
Math Function in PHP


Happy Coding 🙂 

3 thoughts on “DWPD:3.6: Write PHP script to demonstrate math functions.”

Leave a comment