3 + 1 = 4
3 - 1 = 2
3 * 1 = 3
3 / 1 = 3
3 % 1 = 0
5 + 17 = 22
5 - 17 = -12
5 * 17 = 85
5 / 17 = 0.29411764705882
5 % 17 = 5
15 + 22 = 37
15 - 22 = -7
15 * 22 = 330
15 / 22 = 0.68181818181818
15 % 22 = 15
2 + 15 = 17
2 - 15 = -13
2 * 15 = 30
2 / 15 = 0.13333333333333
2 % 15 = 2
737 + 5 = 742
737 - 5 = 732
737 * 5 = 3685
737 / 5 = 147.4
737 % 5 = 2
14 + 256 = 270
14 - 256 = -242
14 * 256 = 3584
14 / 256 = 0.0546875
14 % 256 = 14
626 + 34 = 660
626 - 34 = 592
626 * 34 = 21284
626 / 34 = 18.411764705882
626 % 34 = 14
15 + 1425 = 1440
15 - 1425 = -1410
15 * 1425 = 21375
15 / 1425 = 0.010526315789474
15 % 1425 = 15
32 + 11 = 43
32 - 11 = 21
32 * 11 = 352
32 / 11 = 2.9090909090909
32 % 11 = 10
Code:
<html>
<head>
<title>PHP TEST YAHHH</title>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
<body>
<div class="topbar">
<?php
include 'navbar.php';
?>
</div>
<?php
// ex 2.1
function addNumbers ($a, $b) {
echo "$a + $b = ";
echo $a+$b;
echo "<br>";
echo "$a - $b = ";
echo $a-$b;
echo "<br>";
echo "$a * $b = ";
echo $a*$b;
echo "<br>";
echo "$a / $b = ";
echo $a/$b;
echo "<br>";
echo "$a % $b = ";
echo $a%$b;
echo "<br>";
echo "<br>";
}
addNumbers(3, 1);
addNumbers(5, 17);
addNumbers(15, 22);
addNumbers(2, 15);
addNumbers(737, 5);
addNumbers(14, 256);
addNumbers(626, 34);
addNumbers(15, 1425);
addNumbers(32, 11);
?>
<div class="codebox">
<h3>Code:</h3>
<?php
highlight_file("ex004.php");
?>
</div>
</body>
</html>