Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Javascript arithmetic

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 96
    Comment on it

    Arithmetic operators perform arithmetic on numbers or literals or variables. 1) + addition
    2) - subtraction
    3) * multiplication
    4) / division
    5) % modulus
    6) ++ increment
    7) -- decrement

    <!DOCTYPE html>
    <html>
    <body>
    
    <p>A typical arithmetic operation </p>
    
    <p id="sample"></p>
    
    <script>
    var a = 100;
    var b = 50;
    var x = a + b;
    document.write(x);
    var y = a-b;
    document.write(y);
    var z = a*b;
    document.write(z);
    var m= a%b;
    document.write(m);
    var d=a/b;
    document.write(d);
    </script>
    
    </body>
    </html>
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: