Arthmatic Operator
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title></title>
- </head>
- <body>
- <script type="text/javascript">
- var a= 21; //Variable def
- var b= 10;
- var c;
- //Addition
- c = a + b;
- document.write("the addition is :"+c+"<br>"); // document.write() use for print line.
- //Subtraction
- c = a - b;
- document.write("the subtraction is :"+c+"<br>"); // +c+ is used to indicate which value should be print.
- //Multiplication
- c = a * b;
- document.write("the multipliation is :"+c+"<br>");// <br> use for linebreake
- //Division
- c = a / b;
- document.write("the divition is :"+c+"<br>");
- //Modulus
- c = a % b;
- document.write("the modulus is :"+c+"<br>");
- </script>
- </body>
- </html>
//Execute
//Output
/*
the addition is :31
the subtraction is :11
the multipliation is :210
the divition is :2.1
the modulus is :1
*/
//ThE ProFessor