<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="utf-8">
    <title>Operator Aritmatika JavaScript</title>
</head>
<body>
    <script>
    var x = 10;
    var y = 4;
    document.write(x + y); // Cetak: 14
    document.write("<br>");
    
    document.write(x - y); // Cetak: 6
    document.write("<br>");
    
    document.write(x * y); // Cetak: 40
    document.write("<br>");
    
    document.write(x / y); // Cetak: 2.5
    document.write("<br>");
    
    document.write(x % y); // Cetak: 2
    </script>
</body>
</html>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.