PHP code example of doublegunz / belajar-aritmatika
1. Go to this page and download the library: Download doublegunz/belajar-aritmatika library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
doublegunz / belajar-aritmatika example snippets
php
e Aritmatika\Aritmatika;
$aritmatika = new Aritmatika;
$a = 10;
$b = 5;
$jml = $aritmatika->penjumlahan($a, $b);
$krg = $aritmatika->pengurangan($a, $b);
$kali = $aritmatika->perkalian($a, $b);
$bagi = $aritmatika->pembagian($a, $b);
$hasilBagi = $aritmatika->hasilBagi($a, $b);
echo "hasil {$a} + {$b} adalah {$jml}.<br/>";
echo "hasil {$a} - {$b} adalah {$krg}.<br/>";
echo "hasil {$a} x {$b} adalah {$kali}.<br/>";
echo "hasil {$a} : {$b} adalah {$bagi}.<br/>";
echo "hasil {$a} % {$b} adalah {$hasilBagi}.<br/>";