function

Run Settings
LanguagePHP
Language Version
Run Command
<?php function aritmatika($value1, $value2, $tugas){ if($tugas == "-"){ $hasil = $value1 - $value2; }else if($tugas == "+"){ $hasil = $value1 + $value2; }else if ($tugas == "/") { $hasil = $value1 / $value2; }else if($tugas == "*"){ $hasil = $value1 * $value2; } return $hasil; } echo aritmatika(1,7, "-"); echo "\n"; echo aritmatika(1,7, "+"); echo "\n"; echo aritmatika(1,7, "/"); echo "\n"; echo aritmatika(1,7, "*"); echo "\n"; // untuk berpindah ke baris bawah bisa menggunakan <br> $nilai1 = 80; $nilai2 = 68; $tugasnya = "/"; echo aritmatika($nilai1, $nilai2, $tugasnya); ?>
Editor Settings
Theme
Key bindings
Full width
Lines