javascript中算术运算符示例说明


摘要:
下文通过示例的方式javascript中算术运算符的相关说明,如下所示;

<meta charset='utf-8' />
<p>
 maomao365.com<br />
 js算术运算符示例说明 
</p>
<hr />  
<script>
 var a = 111;
 var b = 555;
 var c = 998;
 var result = "算术运算符:";
 var newLine = "<br />";
         
            document.write("a + b = ");
            result = a + b;
            document.write(result);
            document.write(newLine);
         
            document.write("a - b = ");
            result = a - b;
            document.write(result);
            document.write(newLine);
         
            document.write("a / b = ");
            result = a / b;
            document.write(result);
            document.write(newLine);
         
            document.write("a % b = ");
            result = a % b;
            document.write(result);
            document.write(newLine);
         
            document.write("a + b + c = ");
            result = a + b + c;
            document.write(result);
            document.write(newLine);
         
            a = ++a;
            document.write("++a = ");
            result = ++a;
            document.write(result);
            document.write(newLine);
         
            b = --b;
            document.write("--b = ");
            result = --b;
            document.write(result);
            document.write(newLine);
         //-->
</script>
javascript中算术运算符的示例说明

javascript中算术运算符的示例说明