forked from assembler-institute/php-basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
37 lines (29 loc) · 739 Bytes
/
functions.php
File metadata and controls
37 lines (29 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
function sumOfBoth(int $a, int $b){
return $a + $b;
}
echo sumOfBoth(5,7);
echo "<br><br>";
function multOfBoth(int $a, int $b){
return $a * $b;
}
echo multOfBoth(10,7);
echo "<br><br>";
function divOfBoth(int $a, int $b){
return $a / $b;
}
echo divOfBoth(70,7);
echo "<br><br>";
function all(int $a,int $b, int $c, int $d){
return $a + $b * $c / $d;
}
echo all(70, 7, 8, 6);
echo "<br><br>";
$x=100;
$y=60;
echo "The sum of x and y is : ". ($x+$y) ."<br />";
echo "The difference between x and y is : ". ($x-$y) ."<br />";
echo "Multiplication of x and y : ". ($x*$y) ."<br />";
echo "Division of x and y : ". ($x/$y) ."<br />";
echo "Modulus of x and y : " . ($x%$y) ."<br />";
?>